You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment:
OS: macOS High Sierra 10.13.6
Node: 8.9.2
Yarn: 1.7.0
npm: 6.2.0
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.4.2 => 16.4.2
react-dom: ^16.4.2 => 16.4.2
react-scripts: 1.1.4 => 1.1.4
Steps to Reproduce
npx create-react-app jest-each-bug
cd jest-each-bug/
echo'test.each([1])('t', a => expect(a).toBe(1))'> src/some.test.js
CI=true npm run test
Expected Behavior
Test should run.
Actual Behavior
💣 TypeError: test.each is not a function
console output
> [email protected] test /private/tmp/jest-each-bug
> react-scripts test --env=jsdom
PASS src/App.test.js
FAIL src/some.test.js
● Test suite failed to run
TypeError: test.each is not a function
at Object.<anonymous> (src/some.test.js:1:108)
at <anonymous>
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.129s
Ran all test suites.
Reproducible Demo
See "Steps to Reproduce" above, creates demo project.
The text was updated successfully, but these errors were encountered:
This was added in Jest 23.
create-react-app is on version 20.0.4 in master and 22.4.3 in next.
jest-each is still available as a separate package, but the syntax is a bit different:
npx create-react-app jest-each-bug
cd jest-each-bug/
yarn add jest-each
echo"import each from 'jest-each'; each([1]).test('t', a => expect(a).toBe(1))"> src/some.test.js
CI=true npm run test
PASS src/App.test.js
PASS src/some.test.js
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 3.776s
Ran all test suites.
Is this a bug report?
(write your answer here)
Yes.
Did you try recovering your dependencies?
Yes, tried it with a newly created project.
Which terms did you search for in User Guide?
jest
,.each
Environment
Steps to Reproduce
Expected Behavior
Test should run.
Actual Behavior
💣
TypeError: test.each is not a function
console output
Reproducible Demo
See "Steps to Reproduce" above, creates demo project.
The text was updated successfully, but these errors were encountered: