-
Notifications
You must be signed in to change notification settings - Fork 524
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 #1813 was fixed by #1800 which is already landed. #1805 also fixes via a different mechanism and will also land soon.
- Loading branch information
1 parent
a19eb2b
commit c997c99
Showing
6 changed files
with
1,904 additions
and
17 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,21 @@ | ||
load("@npm//jest-cli:index.bzl", "jest_test") | ||
|
||
jest_test( | ||
name = "test", | ||
data = [ | ||
"index.test.js", | ||
"jest.config.js", | ||
"@npm//jest", | ||
"@npm//jest-websocket-mock", | ||
"@npm//mock-socket", | ||
], | ||
templated_args = [ | ||
"--no-cache", | ||
"--no-watchman", | ||
"--ci", | ||
# On Windows, spawing workers is broken | ||
"--runInBand", | ||
"--config", | ||
"$$(rlocation $(rootpath jest.config.js))", | ||
], | ||
) |
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); | ||
}); |
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,4 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
testMatch: ['**/*.test.js'], | ||
}; |
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
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,16 @@ | ||
diff --git a/node_modules/jest-haste-map/build/crawlers/node.js b/node_modules/jest-haste-map/build/crawlers/node.js | ||
index 349c3bd..08ba33b 100644 | ||
--- a/node_modules/jest-haste-map/build/crawlers/node.js | ||
+++ b/node_modules/jest-haste-map/build/crawlers/node.js | ||
@@ -205,7 +205,11 @@ function find(roots, extensions, ignore, callback) { | ||
|
||
function findNative(roots, extensions, ignore, callback) { | ||
const args = Array.from(roots); | ||
+ args.push('('); | ||
args.push('-type', 'f'); | ||
+ args.push('-o'); | ||
+ args.push('-type', 'l'); | ||
+ args.push(')'); | ||
|
||
if (extensions.length) { | ||
args.push('('); |
Oops, something went wrong.