Verifies that symbolic links aren't included in test run. Usage installs the fork viddo/jest that includes a fix to follow symlinks for crawling files to test.
- install yarn (since that's what jest endorse over npm)
- Install dependencies by running
yarn run install
, or./install.sh
directly - Execute tests by
yarn test
(current, default behavior) andyarn test-follow-symlinks
(new flag/behavior, to include symlinked test files).
Example output:
yarn test
yarn test v0.27.5
$ jest
No tests found
In /Users/nicklas/src/jest-symlinks-probing
3 files checked.
testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 1 match
testPathIgnorePatterns: other - 2 matches
Pattern: - 0 matches
Done in 0.56s.
~/src/jest-symlinks-probing ⑂ master yarn run test-follow-symlinks
Test run which includes the new followSymlinks
flag to include test files that are symlinked:
yarn test-follow-symlinks
$ yarn run v0.27.5
$ jest --followSymlinks
watchman can not be used with followSymlinks, watchman will be disabled
PASS src/linked.test.js
real
✓ test (5ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.7s, estimated 1s
Ran all test suites.
Done in 1.33s.
yarn install
- Use development build of viddo/jest fork by following official facebook/jest contributor instructions, see "How to try a development build of Jest in another project"
yarn link jest-cli