Closed ZigaVukcevicDev closed 8 years ago
Hi @be-codified,
unfortunately this is not that easy in webpack based setups. Basically you have two options: Either run the whole tests (in best case using npm run test:watch mode) or you have to adjust the file test/loadtest.js to match your paths.
Here is a quick example:
// Edit file test/loadtest.js:
// Add support for all files in the test directory
// This is the original line, which will include all files that end with the suffix Test.js
// const testsContext = require.context('.', true, /(Test\.js$)/);
// Updated line, will only run tests located in test/components/subfolder that end with MyTestName.js
const testsContext = require.context('./components/subfolder', true, /(MyTestNameTest\.js$)/);
Hope this helps.
It helped, thank you.
@weblogixx I am noticing that consumed time is for raising up the server, not doing the test. Is there any way to leave the server running and then just run test?
Hi @be-codified,
you may just use npm run test:watch
. In this mode, karma will stay active and rerun all tests if you change a file located in src/ or test/.
Oh, great. Thank you again.
Hi,
thank you for the awesome pack.
Can you point me how to run only single test?