kentcdodds / testing-workshop

A workshop for learning how to test JavaScript applications
http://git.io/testing-workshop
1.36k stars 708 forks source link

jest is not starting #111

Closed aditya81070 closed 4 years ago

aditya81070 commented 4 years ago

Environment info:

Problem description:

I am following the jest setup video of the course Testing React applications, v2 at frontend masters'. I have written the test script in mypackage.jsonand trying to runnpm test` command. But jest is showing that there are two configurations. I don't understand that. I tried to find solutions on google search but couldn't found.

Here is the output. Please help so I can continue the setup.

npm test                                                             ✔

> calculator.solution@1.0.0 test /home/neo/frontend-masters/testing-workshop/other/configuration/calculator
> jest

 FAIL  src/__tests__/utils.js
  ● Test suite failed to run

    Multiple configuration files found. Please remove one:
     - package.json
     - .babelrc.js
    from /home/neo/frontend-masters/testing-workshop/other/configuration/calculator

      at names.reduce (node_modules/@babel/core/lib/config/files/configuration.js:133:13)
          at Array.reduce (<anonymous>)
      at loadOneConfig (node_modules/@babel/core/lib/config/files/configuration.js:127:24)
      at findRelativeConfig (node_modules/@babel/core/lib/config/files/configuration.js:102:16)
      at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:113:39)
      at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
      at loadPartialConfig (node_modules/@babel/core/lib/config/partial.js:110:18)
      at ScriptTransformer._getCacheKey (node_modules/@jest/transform/build/ScriptTransformer.js:266:23)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.967s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

Suggested solution:

aditya81070 commented 4 years ago

I found the solution in closed issues. Thanks

polaroidkidd commented 4 years ago

In which issue did you find the solution @aditya81070 ?

dhirajbasukala commented 4 years ago

@polaroidkidd If you or anyone else are here with

Multiple configuration files found issue

then please visit issue #106 or in short, install previous version of jest@23.6.0.