In Brunch.io, how do we run tests
-
12-11-2019 - |
Question
In an application generated by Brunch.io, how do we run tests? I would like to run them via the command line.
For eg., the todos application has quite exhaustive test coverage. But its Cakefile is empty. When I run 'cake test', it doesn't do anything. Can someone please point me in the right direction on the setup work needed to run the tests (either on command line or on browser)?
Solution
Currently there is no official way to run tests in brunch 0.9.
But brunch 1.0 will introduce full support of testing with Mocha and cakefiles.
So you're doing the right thing.
OTHER TIPS
Look at coffee-purist-brunch :
With this skeleton, run
npm test
instead ofbrunch test
ornpm start
in addition tobrunch watch
in order to automatically run tests. This runs the tests directly on the coffeescript files intest/
and utilizes NPM-installed test libraries instead of static ones fromtest/vendor/
as other skeletons do.
And brunch-dutch-baby uses Karma.