Skip to content

Commit

Permalink
reset the state on beforeEach hook
Browse files Browse the repository at this point in the history
to make sure all the tests have the correct state when called.
afterEach do not reset the state after failed tests
  • Loading branch information
Atrue committed Feb 7, 2023
1 parent 216fcf1 commit 047858c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/functional/close-algorithm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import WebSocket from '../../src/websocket';
import networkBridge from '../../src/network-bridge';
import delay from '../../src/helpers/delay';

test.afterEach(() => {
test.beforeEach(() => {
networkBridge.urlMap = {};
});

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/websockets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Server from '../../src/server';
import WebSocket from '../../src/websocket';
import networkBridge from '../../src/network-bridge';

test.afterEach(() => {
test.beforeEach(() => {
networkBridge.urlMap = {};
});

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/network-bridge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import networkBridge from '../../src/network-bridge';

const fakeObject = { foo: 'bar' };

test.afterEach(() => {
test.beforeEach(() => {
networkBridge.urlMap = {};
});

Expand Down

0 comments on commit 047858c

Please sign in to comment.