@@ -2,7 +2,7 @@ import { shallow } from 'vue-test-utils'
2
2
import { resolve } from 'path'
3
3
import TypeScript from './resources/TypeScript.vue'
4
4
import jestVue from '../vue-jest'
5
- import { readFileSync , renameSync } from 'fs'
5
+ import { readFileSync , renameSync , writeFileSync } from 'fs'
6
6
import cache from '../lib/cache'
7
7
8
8
beforeEach ( ( ) => {
@@ -28,3 +28,22 @@ test.skip('generates inline sourcemap', () => {
28
28
const output = jestVue . process ( fileString , filePath )
29
29
expect ( output ) . toContain ( expectedMap )
30
30
} )
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