serverless-jest-plugin icon indicating copy to clipboard operation
serverless-jest-plugin copied to clipboard

Upgrade to Jest v21

Open bengwall opened this issue 8 years ago • 1 comments

This will be a little work because the Jest CLI was re-written with v21 which just recently came out. The runCLI options appear to have been changed and there is little documentation that I can see.

bengwall avatar Nov 10 '17 01:11 bengwall

I don't appear to have any issues running Jest v21 but when I try to upgrade to v22 I get the following error:

$ jest
 FAIL  functions\example.test.js
  ● Test suite failed to run

    TypeError: environment.setup is not a function

      at node_modules/jest-runner/build/run_test.js:112:23

After a Google search I'm guessing this is to do with "serverless-jest-plugin" needing to upgrade.

See:

  • https://github.com/facebook/jest/pull/5245
  • https://github.com/facebook/jest/issues/5119
$ npm ls jest-environment-node

#Broken at v22
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]
        `-- [email protected]
		
#Works at v21
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]
        `-- [email protected]

alexb-uk avatar Jan 08 '18 12:01 alexb-uk