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

Serverless command "invoke test" not found. Run "serverless help" for a list of all available commands.

Open ashish-akshantal opened this issue 3 years ago • 2 comments

my current package.json configuration looks like

"scripts": {
    "deploy": "sls deploy",
    "test": "jest --coverage",
    "test:coverage": "npm run test -- --coverage --watchAll=false || exit 0"
  },
  "jest": {
    "collectCoverage": true,
    "verbose": true,
    "coverageReporters": [
      "json",
      "html"
    ],
    "coverageThreshold": {
      "global": {
        "branches": 90,
        "functions": 90,
        "lines": 90,
        "statements": 90
      }
    }
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "aws-sdk": "^2.930.0",
    "aws-sdk-mock": "^5.2.1",
    "cors": "^2.8.5",
    "joi": "^17.4.0",
    "lodash.get": "^4.4.2",
    "lodash.set": "^4.3.2",
    "moment": "^2.29.1",
    "serverless": "^1.83.3",
    "serverless-jest-plugin": "^0.3.0",
    "serverless-offline": "^4.10.6",
    "serverless-prune-plugin": "^1.5.0",
    "uuidv4": "^6.2.10"
  }

I run sls invoke test and it fails with the error

ashish-akshantal avatar Aug 16 '21 21:08 ashish-akshantal

have u already figure this out ?

EmmanDizon avatar Sep 14 '22 02:09 EmmanDizon

you need to add serverless-jest-plugin in serverless.yml under plugins. For more info, follow the documentation

ZentPeople avatar Dec 15 '22 08:12 ZentPeople