This repository was archived by the owner on Apr 1, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "env": {
3
+ "mocha": true
4
+ },
5
+ "globals": {
6
+ "expect": true,
7
+ "sinon": true
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue' ;
2
+
3
+ Vue . config . productionTip = false ;
4
+
5
+ // require all test files (files that ends with .spec.js)
6
+ const testsContext = require . context ( './specs' , true , / \. s p e c $ / ) ;
7
+ testsContext . keys ( ) . forEach ( testsContext ) ;
8
+
9
+ // require all src files that ends with .js or .vue for coverage.
10
+ // you can also change this to match only the subset of files that
11
+ // you want coverage for.
12
+ const srcContext = require . context ( '../src' , true , / ^ \. \/ .+ \. ( v u e | j s ) $ / ) ;
13
+ srcContext . keys ( ) . forEach ( srcContext ) ;
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue' ;
2
+ import Component from '@/components/{{ name }}' ;
3
+
4
+ describe ( '{{ name }}.vue' , ( ) => {
5
+ it ( 'should render correct contents' , ( ) => {
6
+ const Constructor = Vue . extend ( Component ) ;
7
+ const propsData = { text : 'Test text' } ;
8
+ const vm = new Constructor ( { propsData} ) . $mount ( ) ;
9
+ expect ( vm . $el . querySelector ( 'strong' ) . textContent )
10
+ . to . equal ( propsData . text ) ;
11
+ } ) ;
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments