serverless-jest-plugin
serverless-jest-plugin copied to clipboard
Serverless command "invoke test" not found. Run "serverless help" for a list of all available commands.
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
have u already figure this out ?
you need to add serverless-jest-plugin
in serverless.yml under plugins. For more info, follow the documentation