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 f72c239
Showing
5 changed files
with
1,826 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,15 @@ | ||
// 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; | ||
|
||
// Fails without node-patches symlink guards fix in | ||
// https://github.com/bazelbuild/rules_nodejs/pull/1800 | ||
// and node_modules execroot fix in | ||
// https://github.com/bazelbuild/rules_nodejs/pull/1805: | ||
test('jest-websocket-mock', () => { | ||
const ws = new WS('ws://localhost:1234'); | ||
expect(ws.server).toBeInstanceOf(Server); | ||
}); |
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.