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.
This was change requested by a user on Slack, but is consistent with the Java and Go templates. All templates should try to run tests if they are available.
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:
Signed-off-by: Alex Ellis (OpenFaaS Ltd) alexellis2@gmail.com
This was change requested by a user on Slack, but is consistent with the Java and Go templates. All templates should try to run tests if they are available.