File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 38
38
"eslint-config-airbnb-base" : " ^11.1.0" ,
39
39
"eslint-plugin-html" : " ^2.0.0" ,
40
40
"eslint-plugin-import" : " ^2.2.0" ,
41
+ "vue" : " ^2.1.10" ,
41
42
"vue-loader" : " ^10.3.0" ,
42
43
"vue-template-compiler" : " ^2.1.10" ,
43
44
"webpack" : " ^2.2.1"
Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
+ import Vue from 'vue' ;
2
3
import test from 'ava' ;
3
4
import TestComponent from './test.vue' ;
4
5
5
- test ( 'it works!' , ( t ) => {
6
- t . true ( _ . isString ( TestComponent . _scopeId ) ) ; // eslint-disable-line no-underscore-dangle
6
+ test ( 'works like it does in a browser' , ( t ) => {
7
+ const Constructor = Vue . extend ( TestComponent ) ;
8
+ const vm = new Constructor ( ) . $mount ( ) ;
9
+ t . is ( vm . $el . querySelector ( 'h1' ) . textContent , 'Hello, World!' ) ;
10
+ } ) ;
11
+
12
+ test ( 'sets default data' , ( t ) => {
13
+ t . true ( _ . isFunction ( TestComponent . data ) ) ;
14
+ t . deepEqual ( TestComponent . data ( ) , { name : 'World' } ) ;
7
15
} ) ;
Original file line number Diff line number Diff line change 1
1
<template >
2
- <h1 >Hello, {{ name }}!</h1 >
2
+ <div >
3
+ <h1 >Hello, {{ name }}!</h1 >
4
+ </div >
3
5
</template >
4
6
5
7
<script >
You can’t perform that action at this time.
0 commit comments