Running client tests on CI
Hello,
I'm currently upgrading an app from SafeStack Template v1 to v2 and previously I didn't have any tests for a client, but since you have added the example in the v2, I'm trying to use them.
But the npm run test:live action runs the tests in the "watch" mode and the results are shown in the web app. This is a cool way to develop the tests, but it is not a very practical in the CI, where I'd like to run all the tests.
I've tried change a tests command to
{
"test": "webpack --config webpack.tests.config.js -p"
}
but it obviously doesn't work as expected, since it just creates a .js files out of the Client test project - not run them.
So is there an easy way to do it?
Thank you.
Hi @MortalFlesh you might check out Fable.Mocha repository and specially this section on how to make your tests run in node environment. We may consider in future adding a recipe on how to run these tests in CI on node, or even consider showcasing that in template itself.
or even consider showcasing that in template itself
I vote for including it in the template itself. If it's going to include tests it should have a target for running the tests in CI.
First step for this should be to create a recipe for how to add it so existing SAFE Stack users can benefit from it; next step would be to bake this into v5.
Included in v5