File tree Expand file tree Collapse file tree 15 files changed +47
-48
lines changed Open diff view settings
Expand file tree Collapse file tree 15 files changed +47
-48
lines changed Open diff view settings
Original file line number Diff line number Diff line change 3030 "author" : " Edd Yerburgh" ,
3131 "license" : " MIT" ,
3232 "devDependencies" : {
33+ "@vue/test-utils" : " ^1.0.0-beta.25" ,
3334 "babel-core" : " ^6.25.0" ,
3435 "babel-jest" : " ^20.0.3" ,
3536 "babel-plugin-istanbul" : " ^4.1.4" ,
4950 "stylus" : " ^0.54.5" ,
5051 "typescript" : " ^2.5.2" ,
5152 "vue" : " ^2.4.2" ,
52- "vue-template-compiler" : " ^2.4.2" ,
53- "vue-test-utils" : " git+https://github.com/vuejs/vue-test-utils.git"
53+ "vue-template-compiler" : " ^2.4.2"
5454 },
5555 "peerDependencies" : {
5656 "babel-core" : " ^6.25.0 || ^7.0.0-0" ,
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import FunctionalSFC from './resources/FunctionalSFC.vue'
33
44let wrapper
55const clickSpy = jest . fn ( )
66beforeEach ( ( ) => {
7- wrapper = shallow ( FunctionalSFC , {
7+ wrapper = shallowMount ( FunctionalSFC , {
88 context : {
99 props : { msg : { id : 1 , title : 'foo' } , onClick : clickSpy }
1010 }
@@ -22,12 +22,11 @@ describe('Processes .vue file with functional template', () => {
2222 } )
2323
2424 it ( 'is functional' , ( ) => {
25- // note: for new version of @vue /vue-utils we can use wrapper.isFunctionalComponent for this
26- expect ( wrapper . vm . _vnode . fnOptions . functional ) . toBe ( true )
25+ expect ( wrapper . isFunctionalComponent ) . toBe ( true )
2726 } )
2827
2928 it ( 'handles slot' , ( ) => {
30- wrapper = shallow ( FunctionalSFC , {
29+ wrapper = shallowMount ( FunctionalSFC , {
3130 context : {
3231 props : { msg : { id : 1 , title : '' } } ,
3332 children : [ 'this is a slot' ]
Original file line number Diff line number Diff line change 1- import { mount } from 'vue- test-utils'
1+ import { mount } from '@ vue/ test-utils'
22import FunctionalSFCParent from './resources/FunctionalSFCParent.vue'
33
44test ( 'processes .vue file with functional template from parent' , ( ) => {
Original file line number Diff line number Diff line change 1- import { mount } from 'vue- test-utils'
1+ import { mount } from '@ vue/ test-utils'
22import NoScript from './resources/NoScript.vue'
33
44describe ( 'NoScript' , ( ) => {
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import RenderFunction from './resources/RenderFunction.vue'
33
44test ( 'processes .vue file with no template' , ( ) => {
5- const wrapper = shallow ( RenderFunction )
5+ const wrapper = shallowMount ( RenderFunction )
66
77 expect ( wrapper . is ( 'section' ) ) . toBe ( true )
88} )
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import { resolve } from 'path'
33import TypeScript from './resources/TypeScript.vue'
44import jestVue from '../vue-jest'
@@ -10,14 +10,14 @@ beforeEach(() => {
1010} )
1111
1212test ( 'processes .vue files' , ( ) => {
13- shallow ( TypeScript )
13+ shallowMount ( TypeScript )
1414} )
1515
1616test ( 'processes .vue files without .babelrc' , ( ) => {
1717 const babelRcPath = resolve ( __dirname , '../.babelrc' )
1818 const tempPath = resolve ( __dirname , '../.renamed' )
1919 renameSync ( babelRcPath , tempPath )
20- shallow ( TypeScript )
20+ shallowMount ( TypeScript )
2121 renameSync ( tempPath , babelRcPath )
2222} )
2323
Original file line number Diff line number Diff line change 1- import { shallow , mount } from 'vue- test-utils'
1+ import { shallowMount , mount } from '@ vue/ test-utils'
22import Coffee from './resources/Coffee.vue'
33import CoffeeScript from './resources/CoffeeScript.vue'
44import CoffeeES6 from './resources/CoffeeES6.vue'
@@ -20,19 +20,19 @@ describe('Test CoffeeScript - coffee.spec.js', () => {
2020 } )
2121
2222 test ( 'processes .vue file with lang set to coffee' , ( ) => {
23- shallow ( Coffee )
23+ shallowMount ( Coffee )
2424 } )
2525
2626 test ( 'processes .vue file with lang set to coffeescript' , ( ) => {
27- shallow ( CoffeeScript )
27+ shallowMount ( CoffeeScript )
2828 } )
2929
3030 test ( 'processes .vue file with lang set to coffee (ES6)' , ( ) => {
31- shallow ( CoffeeES6 )
31+ shallowMount ( CoffeeES6 )
3232 } )
3333
3434 test ( 'processes .vue file with lang set to coffeescript (ES6)' , ( ) => {
35- shallow ( CoffeeScriptES6 )
35+ shallowMount ( CoffeeScriptES6 )
3636 } )
3737
3838 test ( 'processes .vue file with lang set to coffeescript (ES6)' , ( ) => {
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import Css from './resources/Css.vue'
33
44describe ( 'processes .vue file with Css style' , ( ) => {
55 let wrapper
66 beforeAll ( ( ) => {
7- wrapper = shallow ( Css )
7+ wrapper = shallowMount ( Css )
88 } )
99
1010 it ( 'should bind from style tags with named module' , ( ) => {
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import Jade from './resources/Jade.vue'
33
44test ( 'processes .vue file with jade template' , ( ) => {
5- const wrapper = shallow ( Jade )
5+ const wrapper = shallowMount ( Jade )
66 expect ( wrapper . is ( 'div' ) ) . toBe ( true )
77 expect ( wrapper . classes ( ) ) . toContain ( 'jade' )
88} )
Original file line number Diff line number Diff line change 1- import { shallow } from 'vue- test-utils'
1+ import { shallowMount } from '@ vue/ test-utils'
22import Less from './resources/Less.vue'
33import LessModule from './resources/LessModule.vue'
44
55describe ( 'processes .vue file with Less style' , ( ) => {
66 it ( 'does not error on less' , ( ) => {
7- const wrapper = shallow ( Less )
7+ const wrapper = shallowMount ( Less )
88 expect ( wrapper . classes ( ) ) . toContain ( 'testLess' )
99 } )
1010
1111 it ( 'does not error on less module' , ( ) => {
12- expect ( ( ) => shallow ( LessModule ) ) . not . toThrow ( )
12+ expect ( ( ) => shallowMount ( LessModule ) ) . not . toThrow ( )
1313 } )
1414} )
You can’t perform that action at this time.
0 commit comments