This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree 5 files changed +24
-14
lines changed
cna-template/template/frameworks/ava
create-nuxt-app/test/snapshots
5 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"scripts" : {
3
- "test" : " ava " ,
3
+ "test" : " <%= pmRun %> test:unit && <%= pmRun %> test:e2e " ,
4
4
"test:unit" : " cross-env TEST=unit ava ./test/specs/**/*" ,
5
5
"test:e2e" : " cross-env TEST=e2e ava ./test/e2e/**/*"
6
6
},
7
7
"devDependencies" : {
8
+ "@ava/babel" : " ^1.0.1" ,
8
9
"@vue/test-utils" : " ^1.0.0-beta.33" ,
9
10
"ava" : " ^3.7.1" ,
10
- "@ava/babel" : " ^1.0.1" ,
11
11
"babel-plugin-module-resolver" : " ^4.0.0" ,
12
- "browser-env" : " ^3.3.0" ,
13
12
"cross-env" : " ^5.2.1" ,
13
+ "jsdom" : " ^16.2.2" ,
14
+ "jsdom-global" : " ^3.0.2" ,
14
15
"require-extension-hooks" : " ^0.3.3" ,
15
16
"require-extension-hooks-babel" : " ^1.0.0" ,
16
- "require-extension-hooks-vue" : " ^2 .0.0"
17
+ "require-extension-hooks-vue" : " ^3 .0.0"
17
18
}
18
19
}
Original file line number Diff line number Diff line change 1
- require ( 'browser-env' ) ( )
2
- const hooks = require ( 'require-extension-hooks' )
3
- const Vue = require ( 'vue' )
1
+ if ( process . env . TEST === 'unit' ) {
2
+ require ( 'jsdom-global' ) ( )
3
+ // https://github.com/nuxt/create-nuxt-app/issues/180#issuecomment-463069941
4
+ window . Date = global . Date = Date
5
+ }
4
6
7
+ const Vue = require ( 'vue' )
5
8
Vue . config . productionTip = false
6
9
7
- // https://github.com/nuxt/create-nuxt-app/issues/180#issuecomment-463069941
8
- window . Date = global . Date = Date
9
-
10
+ const hooks = require ( 'require-extension-hooks' )
10
11
hooks ( 'vue' ) . plugin ( 'vue' ) . push ( )
11
- hooks ( [ 'vue' , 'js' ] ) . exclude ( ( { filename } ) => filename . match ( / \/ n o d e _ m o d u l e s \/ / ) ) . plugin ( 'babel' ) . push ( )
12
+ hooks ( [ 'vue' , 'js' ] )
13
+ . exclude ( ( { filename } ) => filename . match ( / \/ n o d e _ m o d u l e s \/ / ) )
14
+ . plugin ( 'babel' )
15
+ . push ( )
Original file line number Diff line number Diff line change @@ -2659,19 +2659,20 @@ Generated by [AVA](https://avajs.dev).
2659
2659
'@vue/test-utils': '^1.0.0-beta.33',
2660
2660
ava: '^3.7.1',
2661
2661
'babel-plugin-module-resolver': '^4.0.0',
2662
- 'browser-env': '^3.3.0',
2663
2662
'cross-env': '^5.2.1',
2663
+ jsdom: '^16.2.2',
2664
+ 'jsdom-global': '^3.0.2',
2664
2665
'require-extension-hooks': '^0.3.3',
2665
2666
'require-extension-hooks-babel': '^1.0.0',
2666
- 'require-extension-hooks-vue': '^2 .0.0',
2667
+ 'require-extension-hooks-vue': '^3 .0.0',
2667
2668
},
2668
2669
private: true,
2669
2670
scripts: {
2670
2671
build: 'nuxt build',
2671
2672
dev: 'nuxt',
2672
2673
generate: 'nuxt generate',
2673
2674
start: 'nuxt start',
2674
- test: 'ava ',
2675
+ test: 'yarn test:unit && yarn test:e2e ',
2675
2676
'test:e2e': 'cross-env TEST=e2e ava ./test/e2e/**/*',
2676
2677
'test:unit': 'cross-env TEST=unit ava ./test/specs/**/*',
2677
2678
},
Original file line number Diff line number Diff line change 37
37
{
38
38
"packagePatterns" : [" jest" ],
39
39
"groupName" : " jest packages"
40
+ },
41
+ {
42
+ "packagePatterns" : [" ava" , " require-extension-hooks" ],
43
+ "groupName" : " ava packages"
40
44
}
41
45
]
42
46
}
You can’t perform that action at this time.
0 commit comments