@@ -29,23 +29,31 @@ test('processes .vue files using src attributes', () => {
29
29
30
30
test ( 'skip processing if there is no .babelrc' , ( ) => {
31
31
const babelRcPath = resolve ( __dirname , '../.babelrc' )
32
+ const babelRcPath2 = resolve ( __dirname , '../../.babelrc' )
32
33
const tempPath = resolve ( __dirname , '../.renamed' )
34
+ const tempPath2 = resolve ( __dirname , '../../.renamed' )
33
35
renameSync ( babelRcPath , tempPath )
36
+ renameSync ( babelRcPath2 , tempPath2 )
34
37
const filePath = resolve ( __dirname , './resources/Basic.vue' )
35
38
const fileString = readFileSync ( filePath , { encoding : 'utf8' } )
36
39
try {
37
40
jestVue . process ( fileString , filePath )
38
41
} catch ( err ) {
39
42
renameSync ( tempPath , babelRcPath )
43
+ renameSync ( tempPath2 , babelRcPath2 )
40
44
throw err
41
45
}
42
46
renameSync ( tempPath , babelRcPath )
47
+ renameSync ( tempPath2 , babelRcPath2 )
43
48
} )
44
49
45
50
test ( 'logs info when there is no .babelrc' , ( ) => {
46
51
const babelRcPath = resolve ( __dirname , '../.babelrc' )
52
+ const babelRcPath2 = resolve ( __dirname , '../../.babelrc' )
47
53
const tempPath = resolve ( __dirname , '../.renamed' )
54
+ const tempPath2 = resolve ( __dirname , '../../.renamed' )
48
55
renameSync ( babelRcPath , tempPath )
56
+ renameSync ( babelRcPath2 , tempPath2 )
49
57
const info = jest . spyOn ( global . console , 'info' )
50
58
const filePath = resolve ( __dirname , './resources/Basic.vue' )
51
59
const fileString = readFileSync ( filePath , { encoding : 'utf8' } )
@@ -55,9 +63,11 @@ test('logs info when there is no .babelrc', () => {
55
63
expect ( info ) . toHaveBeenCalledWith ( '\n[vue-jest]: no .babelrc found, skipping babel compilation\n' )
56
64
} catch ( err ) {
57
65
renameSync ( tempPath , babelRcPath )
66
+ renameSync ( tempPath2 , babelRcPath2 )
58
67
throw err
59
68
}
60
69
renameSync ( tempPath , babelRcPath )
70
+ renameSync ( tempPath2 , babelRcPath2 )
61
71
jest . resetModules ( )
62
72
} )
63
73
0 commit comments