A simple unit test for a list component in Vue JS.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
config
src
static
test
.babelrc
.editorconfig
.gitignore
.postcssrc.js
README.md
index.html
package.json

README.md

Vue JS Unit Tests

This project contains a unit test for a simple to do list component. The project was set up using vue-cli and the tests are made with Mocha framework and run using Karma.

When the app is running, you can navigate to localhost:8080/#/to-do to find the page for the to do list.

I explain how the test works in my blog post: https://scotch.io/tutorials/how-to-write-a-unit-test-for-vuejs

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

For detailed explanation on how things work, checkout the guide and docs for vue-loader.