preactjs / preact-netlify

Preact's netlify CMS template
15 stars 11 forks source link

Tests script crush after start #7

Open Akiyamka opened 4 years ago

Akiyamka commented 4 years ago

After i try run test script it's fails.

➜ yarn test
yarn run v1.21.1
$ jest
● Validation Error:

  Preset jest-preset-preact not found.
Akiyamka commented 4 years ago

Reason of this bug - outdated version of jest-config package. I upgrade jest package up to ^25.1.0, removing yarn.lock and reinstall all deps for fix that. After that jest starts, and run first test. But now first test crush with another error

➜ yarn test
yarn run v1.21.1
$ jest
 FAIL  tests/header.test.js
  ● Test suite failed to run

    TypeError: createConfig is not a function

      at Object.<anonymous> (node_modules/jest-preset-preact/src/babel-jest.js:4:16)
      at ScriptTransformer._getTransformer (node_modules/@jest/transform/build/ScriptTransformer.js:335:19)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:410:28)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:522:40)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.53s
Ran all test suites.
error Command failed with exit code 1.

Look like i need update something else, but i not understand what exactly. Mayby related issue: https://github.com/preactjs/preact-cli/issues/892