forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(builtin): add test for issue 1813
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
- Loading branch information
1 parent
5c2f6c1
commit 1a57d57
Showing
5 changed files
with
1,825 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,14 @@ | ||
// 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 without node-patches symlink guards fix in | ||
// https://github.com/bazelbuild/rules_nodejs/pull/1800 | ||
}); |
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.