SAFE-template icon indicating copy to clipboard operation
SAFE-template copied to clipboard

Running client tests on CI

Open MortalFlesh opened this issue 5 years ago • 2 comments

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.

MortalFlesh avatar Jan 14 '21 14:01 MortalFlesh

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.

theimowski avatar Jan 21 '21 20:01 theimowski

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.

olivercoad avatar Jan 22 '21 08:01 olivercoad

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.

isaacabraham avatar Mar 03 '23 15:03 isaacabraham

Included in v5

martinbryant avatar Dec 08 '23 11:12 martinbryant