Skip to content

Commit 57be865

Browse files
authored
ci(jest): upgrade to jest 27 (#622)
1 parent 88548fc commit 57be865

File tree

3 files changed

+891
-1602
lines changed

3 files changed

+891
-1602
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@
7171
"express": "^4.17.1",
7272
"get-port": "^5.1.1",
7373
"husky": "^6.0.0",
74-
"jest": "^26.6.3",
74+
"jest": "^27.0.3",
7575
"lint-staged": "^11.0.0",
7676
"mockttp": "^1.2.2",
7777
"open": "^8.0.8",
7878
"prettier": "^2.2.1",
7979
"supertest": "^6.1.3",
80-
"ts-jest": "^26.5.6",
80+
"ts-jest": "^27.0.1",
8181
"typescript": "^4.2.4",
8282
"ws": "^7.4.5"
8383
},

test/e2e/websocket.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('E2E WebSocket proxy', () => {
4848
});
4949

5050
describe('option.ws', () => {
51-
beforeEach(async (done) => {
51+
beforeEach(async () => {
5252
proxyServer = createApp(proxyMiddleware).listen(SERVER_PORT);
5353

5454
// quick & dirty Promise version of http.get (don't care about correctness)
@@ -59,8 +59,10 @@ describe('E2E WebSocket proxy', () => {
5959
// do a second http request to make sure only 1 listener subscribes to upgrade request
6060
await get(`http://localhost:${SERVER_PORT}/`);
6161

62-
ws = new WebSocket(`ws://localhost:${SERVER_PORT}/socket`);
63-
ws.on('open', done);
62+
return new Promise((resolve) => {
63+
ws = new WebSocket(`ws://localhost:${SERVER_PORT}/socket`);
64+
ws.on('open', resolve);
65+
});
6466
});
6567

6668
it('should proxy to path', (done) => {
@@ -81,7 +83,7 @@ describe('E2E WebSocket proxy', () => {
8183
ws.on('open', done);
8284
});
8385

84-
it('should proxy to path', async (done) => {
86+
it('should proxy to path', (done) => {
8587
ws.on('message', (message) => {
8688
expect(message).toBe('foobar');
8789
done();

0 commit comments

Comments
 (0)