eddyerburgh / vue-unit-test-starter

Starter project for Vue unit testing tutorials
6 stars 5 forks source link

Test suite failed to run #2

Open farahriz opened 5 years ago

farahriz commented 5 years ago

Thanks very much for your tutorial, Edd!

After running $npm run unit, I am greeted by this error, although the smoke test should pass Error is as follows:

`$npm run unit

vue-test-utils-jest-example@1.0.0 unit C:\Users\user\Documents\vue-unit-test-starter jest --verbose

FAIL src/components/tests/MessageToggle.spec.js ● Test suite failed to run

Plugin/Preset files are not allowed to export objects, only functions. In C:\Users\user\Documents\vue-unit-test-starter\node_modules\babel-preset-stage-2\lib\index.js

  at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
  at items.map (node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
      at Array.map (<anonymous>)
  at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
  at createPresetDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:101:10)      at presets (node_modules/@babel/core/lib/config/config-descriptors.js:47:19)
  at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:320:26)
  at node_modules/@babel/core/lib/config/config-chain.js:283:7
  at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:120:22)
  at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)

Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total Time: 2.067s Ran all test suites. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! vue-test-utils-jest-example@1.0.0 unit: jest --verbose npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the vue-test-utils-jest-example@1.0.0 unit script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-05-10T06_03_03_145Z-debug.log`

Apparently, the line that is causing issues is "unit": "jest" in scripts.

eddyerburgh commented 5 years ago

Hi sorry, this is due to a version mismatch. I'll update my tutorial to use the latest versions of each package

chrisj-skinner commented 5 years ago

I second this - same error when I tried it today