Write blazing fast Vue unit tests with Tape and Vue Test Utils

Edd Yerburgh
Oct 1, 2017 · 5 min read
Tape and Vue — a match made in heaven

What is Tape?

Why Tape?

Bootstrapping the project

git clone https://github.com/eddyerburgh/jest-vue-starter.git
cd jest-vue-starter && npm install

Setting up Tape and Vue Test Utils

npm install --save-dev tape @vue/test-utils
npm install --save-dev browser-env
npm install --save-dev require-extension-hooks require-extension-hooks-babel require-extension-hooks-vue
"unit": "tape ./test/specs/*.spec.js -r ./test/setup.js"
npm run unit
npm install --save-dev tap-spec
"unit": "tape ./test/specs/*.spec.js -r ./test/setup.js | tap-spec"
npm run unit

Writing tests with Tape and Vue Test Utils

Pros and cons of Tape

Pros

Cons

Call to action

freeCodeCamp.org

This is no longer updated. Go to https://freecodecamp.org/news instead

Edd Yerburgh

Written by

freeCodeCamp.org

This is no longer updated. Go to https://freecodecamp.org/news instead