-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run unit tests for node12 if present
This change allows npm test to be run in during the Docker build of code using the node12 template. Unfortunately the package.json that the template generated will fail for any users who take this newer version, unless they edit the "test" section of their package.json file. This is because it is hard-coded to "exit 1", the newer change is set to "exit 0" and to only show a warning about tests missing. It will not affect any functions that are created after this time. Tested with 3 scenarios: * Tests given which passed, with mocha and chai * Tests given which failed with mocha and chai * No tests given at all Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
- Loading branch information
Showing
4 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"name": "function", | ||
"name": "openfaas-function", | ||
"version": "1.0.0", | ||
"description": "", | ||
"description": "OpenFaaS Function", | ||
"main": "handler.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 0" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
"author": "OpenFaaS Ltd", | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
language: node12 | ||
fprocess: node index.js | ||
welcome_message: | | ||
You have created a new function which uses Node.js 12.13.0 and the OpenFaaS | ||
of-watchdog. | ||
You have created a new function which uses Node.js 12 (TLS) and the OpenFaaS | ||
of-watchdog which gives greater control over HTTP responses. | ||
npm i --save can be used to add third-party packages like request or cheerio | ||
npm documentation: https://docs.npmjs.com/ | ||
Unit tests are run at build time via "npm run", edit package.json to specify | ||
how you want to execute them. | ||