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

how to define jest configuration in custom file

Open ozbillwang opened this issue 7 years ago • 2 comments

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 avatar Nov 15 '17 22:11 ozbillwang

@ozbillwang did you ever find a solution to your problem?

taschik avatar Jan 23 '24 14:01 taschik

no, i moved on with aws sam.

ozbillwang avatar Jan 23 '24 19:01 ozbillwang