I have just started with Jest today. I have a simple test file in my __tests__
directory. Here is the current test file:
describe('ChangeCalendarView', function() {
it('true', function() {
expect(3).toBe(3);
})
});
This runs with no issue. When I add another file, with the same exact code, other than the description:
describe('ChangeTimePeriod', function() {
it('true', function() {
expect(3).toBe(3);
})
});
Then I get this error:
/usr/local/lib/node_modules/jest-cli/node_modules/node-worker-pool/Worker.js:93
throw new Error('Received unexpected data from child process: ' + data);
^
Error: Received unexpected data from child process: {
"error": "Error: ENOENT, open '/usr/local/lib/node_modules/jest-cli/.haste_cache/cache-react-calendar-component'\n\n"
}
at Worker._onStdout (/usr/local/lib/node_modules/jest-cli/node_modules/node-worker-pool/Worker.js:93:11)
Does this make sense to anyone?
If you want to specify exact multiple files to run tests on, just separate files' names with space.
The glob patterns Jest uses to detect test files. By default it looks for .js and .jsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js. So name your test file with suffix .test .Like pagination.test.js .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With