- vue-test-utils - rendering and dom helper library
example (more)
This example shows the basics of unit and e2e testing of basic vue components.
Unit Testing:
Tools: vue-test-utils, jest
Unit tests can be found in the unit/specs folder for the Counter and Toggle components. Note the ability to shallow
render these components for testing, allowing for dom-like interaction and events without the need for a browser. This allows for isolated testing of the components that execute very quickly.
E2E Testing:
Tools: nightwatch.js
E2E tests can be found in the e2e/specs folder. The E2E tests are browser automation tests and when run will launch and orchestrate a browser on your machine via selenium. Tests are written with nightwatch.js which provides expect
, assert
and command
apis.
Note: The example project is a full app boilerplate generated with the vue-cli webpack template. Because of this, there is a lot more than testing going on in this folder. Focus on the components and test folders for the purposes of the testing evaluation.