forked from aspect-build/rules_jest
-
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.
feat: default cacheDirectory to TEST_TMPDIR
See aspect-build#230
- Loading branch information
1 parent
cb7b5bf
commit e2963db
Showing
5 changed files
with
37 additions
and
1 deletion.
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,15 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit -o nounset -o pipefail | ||
|
||
# Jest default is os.tmpdir()/jest_<uid> | ||
TEST_TMPDIR=$(mktemp -d)/jest_test_tmpdir | ||
|
||
# Case 13: jest_test uses TEST_TMPDIR | ||
rm -rf $TEST_TMPDIR | ||
bazel test //jest/tests:case13 --nocache_test_results --test_tmpdir=$TEST_TMPDIR | ||
|
||
# Check if TEST_TMPDIR was utilized by the test action | ||
if [ ! -d "$TEST_TMPDIR" ] || [ -z "$(ls -A "$TEST_TMPDIR")" ]; then | ||
echo "Error: test_tmpdir '$TEST_TMPDIR' does not exist or is empty" | ||
exit 1 | ||
fi |
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
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,5 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test("it should work", () => { | ||
expect(1).toBe(1); | ||
}); |