Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I include testing in an existing project created with vue cli?

When I do vue init webpack my-project according to these instructions, I'm given a questionaire where I'm asked if I want to include linting and testing. If I say yes, the project is set up with testing in place.

However in one of my vue projects, I started it out without saying yes. But now, I want to include unit testing.

Traditional methods of installing Karma and Jasmine seems too cumbersome and I don't know which files I need to modify in order to wire up all the dependencies correctly.

Is there a CLI command that I can run, that asks me those questions again so that it wires up unit testing for me, automatically?

like image 725
Divyanth Jayaraj Avatar asked Jan 27 '17 17:01

Divyanth Jayaraj


1 Answers

This is old but came across it when looking to add testing to my vue project that was scaffold with vue-cli and fwiw if you are using Vue Cli 3 you can run vue add @vue/unit-jest to add testing to an existing project.

like image 153
Kevin W Avatar answered Sep 17 '22 20:09

Kevin W