Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #4845
Closed
Open
Issue created Aug 02, 2018 by Administrator@rootContributor

jest Error "test.each is not a function"

Created by: eins78

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

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

> jest-each-bug@0.1.0 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.

Assignee
Assign to
Time tracking