Skip to content

Commit

Permalink
ci(jest): upgrade to jest 27 (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
chimurai committed May 30, 2021
1 parent 88548fc commit 57be865
Show file tree
Hide file tree
Showing 3 changed files with 891 additions and 1,602 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
"express": "^4.17.1",
"get-port": "^5.1.1",
"husky": "^6.0.0",
"jest": "^26.6.3",
"jest": "^27.0.3",
"lint-staged": "^11.0.0",
"mockttp": "^1.2.2",
"open": "^8.0.8",
"prettier": "^2.2.1",
"supertest": "^6.1.3",
"ts-jest": "^26.5.6",
"ts-jest": "^27.0.1",
"typescript": "^4.2.4",
"ws": "^7.4.5"
},
Expand Down
10 changes: 6 additions & 4 deletions test/e2e/websocket.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('E2E WebSocket proxy', () => {
});

describe('option.ws', () => {
beforeEach(async (done) => {
beforeEach(async () => {
proxyServer = createApp(proxyMiddleware).listen(SERVER_PORT);

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

ws = new WebSocket(`ws://localhost:${SERVER_PORT}/socket`);
ws.on('open', done);
return new Promise((resolve) => {
ws = new WebSocket(`ws://localhost:${SERVER_PORT}/socket`);
ws.on('open', resolve);
});
});

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

it('should proxy to path', async (done) => {
it('should proxy to path', (done) => {
ws.on('message', (message) => {
expect(message).toBe('foobar');
done();
Expand Down

0 comments on commit 57be865

Please sign in to comment.