-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8cc8df
commit 00a4c20
Showing
5 changed files
with
1,820 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@npm//jest-cli:index.bzl", "jest_test") | ||
|
||
jest_test( | ||
name = "test", | ||
args = [ | ||
"--config", | ||
"$(rootpath jest.config.js)", | ||
"--runTestsByPath", | ||
"$(rootpath index.test.js)", | ||
], | ||
data = [ | ||
"index.test.js", | ||
"jest.config.js", | ||
"@npm//jest", | ||
"@npm//jest-websocket-mock", | ||
"@npm//mock-socket", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Loaded from common-js format | ||
// node_modules/jest-websocket-mock/lib/jest-websocket-mock.cjs.js | ||
const WS = require('jest-websocket-mock').default; | ||
// Loaded from js format | ||
// node_modules/mock-socket/dist/mock-socket.js" | ||
const Server = require('mock-socket').Server; | ||
|
||
test('jest-websocket-mock', () => { | ||
const ws = new WS('ws://localhost:1234'); | ||
console.log(ws.server.constructor); // [Function: Server] { of: [Function: of] } | ||
console.log(Server); // [Function: Server] { of: [Function: of] } | ||
expect(ws.server).toBeInstanceOf(Server); // FAILS | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.