Using vuejs's Single File Components, webpack, karma, jasmine
prerequisites: NodeJS, Chrome
$ npm install
$ npm run build
On one terminal window/tab, start the Karma server:
$ npx cross-env BABEL_ENV=test karma start --no-watch --no-progress
Then on your main terminal, to run the test, type:
$ npm run test
If you don't want to start a server, you can do a single run of karma. Not advised though as it's a bit fragile
$ npx cross-env BABEL_ENV=test karma start -no-watch --no-progress --single-run
Inspired by the examples from VueJS docs and the boilerplate Github repo made by Edd Yerburgh to test VueJS app with Karma/Mocha/Chai: vue-test-utils-karma-example
Note: Whose book can be found here:Testing Vue.js Applications
I wanted to create a skeleton project for the future me whenever I need to spin off a VueJS project to test with Jasmine while learning how to use these tools together.
This is a follow up to my single web page CodePen example for testing a VueJS app using Jasmine: VueJS Unit testing with Jasmine