@@ -2,7 +2,7 @@ import { shallow } from 'vue-test-utils'
22import { resolve } from 'path'
33import TypeScript from './resources/TypeScript.vue'
44import jestVue from '../vue-jest'
5- import { readFileSync , renameSync } from 'fs'
5+ import { readFileSync , renameSync , writeFileSync } from 'fs'
66import cache from '../lib/cache'
77
88beforeEach ( ( ) => {
@@ -28,3 +28,22 @@ test.skip('generates inline sourcemap', () => {
2828 const output = jestVue . process ( fileString , filePath )
2929 expect ( output ) . toContain ( expectedMap )
3030} )
31+
32+ test ( 'processes without sourcemap' , ( ) => {
33+ const configPath = resolve ( __dirname , '../tsconfig.json' )
34+ const tsconfigString = readFileSync ( configPath , { encoding : 'utf8' } )
35+ const tsconfig = JSON . parse ( tsconfigString )
36+ tsconfig . compilerOptions . sourceMap = false
37+ writeFileSync ( configPath , JSON . stringify ( tsconfig ) )
38+ const filePath = resolve ( __dirname , './resources/TypeScript.vue' )
39+ const fileString = readFileSync ( filePath , { encoding : 'utf8' } )
40+
41+ try {
42+ expect ( ( ) => jestVue . process ( fileString , filePath ) ) . not . toThrow ( )
43+ } catch ( err ) {
44+ writeFileSync ( configPath , tsconfigString )
45+ throw err
46+ }
47+
48+ writeFileSync ( configPath , tsconfigString )
49+ } )
0 commit comments