@@ -29,23 +29,31 @@ test('processes .vue files using src attributes', () => {
2929
3030test ( 'skip processing if there is no .babelrc' , ( ) => {
3131 const babelRcPath = resolve ( __dirname , '../.babelrc' )
32+ const babelRcPath2 = resolve ( __dirname , '../../.babelrc' )
3233 const tempPath = resolve ( __dirname , '../.renamed' )
34+ const tempPath2 = resolve ( __dirname , '../../.renamed' )
3335 renameSync ( babelRcPath , tempPath )
36+ renameSync ( babelRcPath2 , tempPath2 )
3437 const filePath = resolve ( __dirname , './resources/Basic.vue' )
3538 const fileString = readFileSync ( filePath , { encoding : 'utf8' } )
3639 try {
3740 jestVue . process ( fileString , filePath )
3841 } catch ( err ) {
3942 renameSync ( tempPath , babelRcPath )
43+ renameSync ( tempPath2 , babelRcPath2 )
4044 throw err
4145 }
4246 renameSync ( tempPath , babelRcPath )
47+ renameSync ( tempPath2 , babelRcPath2 )
4348} )
4449
4550test ( 'logs info when there is no .babelrc' , ( ) => {
4651 const babelRcPath = resolve ( __dirname , '../.babelrc' )
52+ const babelRcPath2 = resolve ( __dirname , '../../.babelrc' )
4753 const tempPath = resolve ( __dirname , '../.renamed' )
54+ const tempPath2 = resolve ( __dirname , '../../.renamed' )
4855 renameSync ( babelRcPath , tempPath )
56+ renameSync ( babelRcPath2 , tempPath2 )
4957 const info = jest . spyOn ( global . console , 'info' )
5058 const filePath = resolve ( __dirname , './resources/Basic.vue' )
5159 const fileString = readFileSync ( filePath , { encoding : 'utf8' } )
@@ -55,9 +63,11 @@ test('logs info when there is no .babelrc', () => {
5563 expect ( info ) . toHaveBeenCalledWith ( '\n[vue-jest]: no .babelrc found, skipping babel compilation\n' )
5664 } catch ( err ) {
5765 renameSync ( tempPath , babelRcPath )
66+ renameSync ( tempPath2 , babelRcPath2 )
5867 throw err
5968 }
6069 renameSync ( tempPath , babelRcPath )
70+ renameSync ( tempPath2 , babelRcPath2 )
6171 jest . resetModules ( )
6272} )
6373
0 commit comments