-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with jest not supporting symlinks
This adds jest.bzl and uses it to pass in specific tests. See jestjs/jest#7549
- Loading branch information
Showing
3 changed files
with
33 additions
and
16 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,29 @@ | ||
load("@npm//jest-cli:index.bzl", "jest", _jest_test = "jest_test") | ||
|
||
def jest_test(name, srcs, deps, jest_config, **kwargs): | ||
"A macro around the autogenerated jest_test rule" | ||
templated_args = [ | ||
"--no-cache", | ||
"--no-watchman", | ||
"--ci", | ||
"--colors", | ||
] | ||
templated_args.extend(["--config", "$(rootpath %s)" % jest_config]) | ||
for src in srcs: | ||
templated_args.extend(["--runTestsByPath", "$(rootpaths %s)" % src]) | ||
|
||
data = [jest_config] + srcs + deps | ||
_jest_test( | ||
name = name, | ||
data = data, | ||
templated_args = templated_args, | ||
**kwargs | ||
) | ||
|
||
# This rule is used specifically to update snapshots via `bazel run` | ||
jest( | ||
name = "%s.update" % name, | ||
data = data, | ||
templated_args = templated_args + ["-u"], | ||
**kwargs | ||
) |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
module.exports = { | ||
reporters: ['default'], | ||
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