Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serverless-jest-plugin does not trigger other plugins before running tests. (webpack for example) #6

Open
0o-de-lally opened this issue Jul 5, 2017 · 1 comment

Comments

@0o-de-lally
Copy link

cross posted here: serverless-heaven/serverless-webpack#143

Seems like the test runner is not loading other plugins before running the tests. There is a suggestion at the discussion linked above.
@laardee any thoughts on this?

Description

I'm trying to ensure that webpack runs before the testing plugin.

It appears tests are running the uncompiled code (not using webpack), and also using the node version. This means I'm not catching all the syntax errors lambda runtime does not support.

Reproduction

It's a bit tricky to reproduce this error, since you'd have to compare the jest test run results to that of a deployed function.
You can break the webpack integration by breaking the config file :

module.exports = {
  entry: null,
...

The test runner will not catch this error, which implies that webpack is not running before the tests.
The only way to catch this is by running serverless webpack serve

Additional Data

package.json

    "babel-core": "^6.13.2",
    "babel-loader": "^6.2.4",
    "babel-plugin-transform-runtime": "^6.12.0",
    "babel-polyfill": "6.13.0",
    "babel-preset-es2015": "^6.13.2",
    "babel-preset-stage-0": "^6.5.0",
    "serverless-jest-plugin": "^0.1.5",
    "serverless-webpack": "^1.0.0-rc.3",
    "webpack": "^1.13.1"

serverles.yml

plugins:
  - serverless-jest-plugin
  - serverless-webpack
@laardee
Copy link
Contributor

laardee commented Jul 10, 2017

@lpgeiger I'll make the same changes to this after the Mocha plugin is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants