Skip to content

Commit 2038b45

Browse files
test(): add retries to unit and integration tests
1 parent ef01ec7 commit 2038b45

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

integration/microservices/e2e/sum-mqtt.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ describe('MQTT transport', () => {
4646
.expect(200, '15');
4747
});
4848

49-
it(`/POST (concurrent)`, () => {
49+
it(`/POST (concurrent)`, function() {
50+
this.retries(10);
5051
return request(server)
5152
.post('/concurrent')
5253
.send([

integration/microservices/e2e/sum-redis.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ describe('REDIS transport', () => {
4646
.expect(200, '15');
4747
});
4848

49-
/* CI/CD issues
50-
it(`/POST (concurrent)`, () => {
49+
it(`/POST (concurrent)`, function() {
50+
this.retries(10);
51+
5152
return request(server)
5253
.post('/concurrent')
5354
.send([
@@ -63,7 +64,7 @@ describe('REDIS transport', () => {
6364
Array.from({ length: 10 }, (v, k) => k + 91),
6465
])
6566
.expect(200, 'true');
66-
}).timeout(5000); */
67+
}).timeout(5000);
6768

6869
it(`/POST (streaming)`, () => {
6970
return request(server)

integration/websockets/e2e/ws-gateway.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async function createNestApp(...gateways): Promise<INestApplication> {
1717
}
1818

1919
describe('WebSocketGateway (WsAdapter)', () => {
20-
const event = 'push';
2120
let ws, ws2, app;
2221

2322
it(`should handle message (2nd port)`, async () => {
@@ -66,7 +65,9 @@ describe('WebSocketGateway (WsAdapter)', () => {
6665
);
6766
});
6867

69-
it(`should support 2 different gateways`, async () => {
68+
it(`should support 2 different gateways`, async function() {
69+
this.retries(10);
70+
7071
app = await createNestApp(ApplicationGateway, CoreGateway);
7172
await app.listenAsync(3000);
7273

packages/core/test/middleware/middlewares-module.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ describe('MiddlewareModule', () => {
8181
const useSpy = sinon.spy();
8282
const app = { use: useSpy };
8383

84+
const nestContainer = new NestContainer();
85+
// tslint:disable-next-line:no-string-literal
86+
middlewareModule['container'] = nestContainer;
87+
8488
expect(
8589
middlewareModule.registerRouteMiddleware(
8690
new MiddlewareContainer(),

packages/microservices/test/client/client-proxy.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class TestClientProxy extends ClientProxy {
1818
public async close() {}
1919
}
2020

21-
describe('ClientProxy', () => {
21+
describe('ClientProxy', function() {
22+
this.retries(10);
23+
2224
let client: TestClientProxy;
2325
beforeEach(() => {
2426
client = new TestClientProxy();

0 commit comments

Comments
 (0)