serverless-jest-plugin
serverless-jest-plugin copied to clipboard
how to define jest configuration in custom file
Here is my serverless file which I define the plugin and variable in a custom file
custom: ${file(${opt:stage, self:provider.stage}.yml)}
plugins: ${self:custom.plugins, ''}
my environment file:
$ cat dev.yml
plugins:
- serverless-jest-plugin
jest:
collectCoverage: true
Here is the error I got.
$ sls create test -f auth
Serverless Error ---------------------------------------
Serverless command "create test" not found
Run "serverless help" for a list of all available commands.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: linux
Node Version: 6.11.3
Serverless Version: 1.24.1
The other variables in custom environment file works fine, which I used to define stage, service name, etc.
If I follow the README to define jest plugin and configuration directly in serverless.yml
, it works.
@ozbillwang did you ever find a solution to your problem?
no, i moved on with aws sam.