-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jest-haste-map): Enable crawling for symlink test files
- Loading branch information
Showing
5 changed files
with
63 additions
and
2 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
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,34 @@ | ||
import runJest from '../runJest'; | ||
import {tmpdir} from 'os'; | ||
import * as path from 'path'; | ||
import {writeFiles, writeSymlinks} from '../Utils'; | ||
import * as fs from 'fs'; | ||
const DIR = path.resolve(tmpdir(), 'crawl-symlinks-test'); | ||
|
||
test('Node crawler picks up symlinked files', () => { | ||
fs.rmdirSync(DIR, {recursive: true}); | ||
|
||
writeFiles(DIR, { | ||
'package.json': ` | ||
{ | ||
"jest": { | ||
"testMatch": ["<rootDir>/test-files/test.js"] | ||
} | ||
} | ||
`, | ||
'symlinked-files/test.js': ` | ||
test('1+1', () => { | ||
expect(1).toBe(1); | ||
}); | ||
`, | ||
}); | ||
|
||
writeSymlinks(DIR, { | ||
'symlinked-files/test.js': 'test-files/test.js', | ||
}); | ||
|
||
const {stdout, stderr, exitCode} = runJest(DIR, ['--no-watchman']); | ||
expect(stderr).toContain('Test Suites: 1 passed, 1 total'); | ||
expect(stdout).toEqual(''); | ||
expect(exitCode).toEqual(0); | ||
}); |
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