File tree 4 files changed +39
-2
lines changed
4 files changed +39
-2
lines changed Original file line number Diff line number Diff line change
1
+ export default {
2
+ name : 'basic' ,
3
+ computed : {
4
+ headingClasses : function headingClasses ( ) {
5
+ return {
6
+ red : this . isCrazy ,
7
+ blue : ! this . isCrazy ,
8
+ shadow : this . isCrazy
9
+ }
10
+ }
11
+ } ,
12
+ data : function data ( ) {
13
+ return {
14
+ msg : 'Welcome to Your Vue.js App' ,
15
+ isCrazy : false
16
+ }
17
+ } ,
18
+ methods : {
19
+ toggleClass : function toggleClass ( ) {
20
+ this . isCrazy = ! this . isCrazy
21
+ }
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ <template src="./BasicSrc.html "></template >
2
+
3
+ <script lang="ts" src="./TsSrc.ts "></script >
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { resolve } from 'path'
3
3
import { readFileSync } from 'fs'
4
4
5
5
import BasicSrc from './components/BasicSrc.vue'
6
+ import TsSrc from './components/TsSrc.vue'
6
7
import Pug from './components/Pug.vue'
7
8
import Coffee from './components/Coffee.vue'
8
9
import Basic from './components/Basic.vue'
@@ -47,13 +48,20 @@ test('processes .vue files', () => {
47
48
)
48
49
} )
49
50
50
- test ( 'processes .vue files with src attributes' , ( ) => {
51
+ test ( 'processes .vue files with js src attributes' , ( ) => {
51
52
mount ( BasicSrc )
52
53
expect ( document . querySelector ( 'h1' ) . textContent ) . toBe (
53
54
'Welcome to Your Vue.js App'
54
55
)
55
56
} )
56
57
58
+ test ( 'processes .vue files with ts src attributes' , ( ) => {
59
+ mount ( TsSrc )
60
+ expect ( document . querySelector ( 'h1' ) . textContent ) . toBe (
61
+ 'Welcome to Your Vue.js App'
62
+ )
63
+ } )
64
+
57
65
test ( 'handles named exports' , ( ) => {
58
66
expect ( randomExport ) . toEqual ( 42 )
59
67
} )
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ module.exports = {
16
16
const tsconfig = getTsJestConfig ( config )
17
17
const babelOptions = getBabelOptions ( filePath )
18
18
19
- const res = typescript . transpileModule ( scriptContent , tsconfig )
19
+ const res = typescript . transpileModule ( scriptContent , {
20
+ ...tsconfig ,
21
+ fileName : filePath
22
+ } )
20
23
21
24
res . outputText = stripInlineSourceMap ( res . outputText )
22
25
You can’t perform that action at this time.
0 commit comments