-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enable test file crawling for jest example #1506
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"bazel.buildifierExecutable": "${workspaceFolder}/node_modules/.bin/buildifier", | ||
"bazel.buildifierFixOnFormat": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ def jest_test(name, srcs, deps, jest_config, **kwargs): | |
"--ci", | ||
] | ||
args.extend(["--config", "$(location %s)" % jest_config]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was expecting to see a glob pattern being added here or in the place jest_test is called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The glob pattern was already present within |
||
for src in srcs: | ||
args.extend(["--runTestsByPath", "$(location %s)" % src]) | ||
|
||
_jest_test( | ||
name = name, | ||
|
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 23985ae..a728a9a 100644 | ||
--- a/node_modules/jest-haste-map/build/crawlers/node.js | ||
+++ b/node_modules/jest-haste-map/build/crawlers/node.js | ||
@@ -166,7 +166,11 @@ function find(roots, extensions, ignore, callback) { | ||
|
||
function findNative(roots, extensions, ignore, callback) { | ||
const args = Array.from(roots); | ||
+ args.push('('); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there an issue or PR open on the upstream repo so there's a chance of unwinding this patch later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my own reference, he's the PR I've started with Jest: jestjs/jest#9351 |
||
args.push('-type', 'f'); | ||
+ args.push('-o'); | ||
+ args.push('-type', 'l'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand where the symlinks are appearing. The node-patches should make it so the source files appear to be in the runfiles tree, not symlinks out of the runfiles. Are you sure the fix belongs in jest and not in the node-patches? Can you show where the symlink appears and where it points? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The symlinks appear within the runfiles tree of the testable target. |
||
+ args.push(')'); | ||
|
||
if (extensions.length) { | ||
args.push('('); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean to check in this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it shouldn't be part of this change, but in general I have to do this to rules_nodejs everytime I try to edit the repo in vscode. It breaks the bazel vscode extensions ability to format build files