1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` TsCompiler isolatedModule false allowJs option should compile js file for allowJs true with outDir 1` ] = `
4
- ===[ FILE: test-allow-js.js ]===================================================
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value : true } );
7
- exports.default = 42;
8
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoidGVzdC1hbGxvdy1qcy5qcyIsIm1hcHBpbmdzIjoiOztBQUFBLGtCQUFlLEVBQUUsQ0FBQSIsIm5hbWVzIjpbXSwic291cmNlcyI6WyJ0ZXN0LWFsbG93LWpzLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IDQyIl0sInZlcnNpb24iOjN9
9
- ===[ INLINE SOURCE MAPS ]=======================================================
10
- file: test-allow-js.js
11
- mappings: ';;AAAA,kBAAe,EAAE,CAAA'
12
- names: []
13
- sources:
14
- - test-allow-js.js
15
- sourcesContent:
16
- - export default 42
17
- version: 3
18
- ================================================================================
4
+ "\\ "use strict\\ ";
5
+ Object.defineProperty(exports, \\ "__esModule\\ ", { value : true } );
6
+ exports.default = 42;
7
+ //# "
19
8
` ;
20
9
21
10
exports [` TsCompiler isolatedModule false allowJs option should compile js file for allowJs true without outDir 1` ] = `
22
- ===[ FILE: test-allow-js.js ]===================================================
23
- "use strict";
24
- Object.defineProperty(exports, "__esModule", { value : true } );
25
- exports.default = 42;
26
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoidGVzdC1hbGxvdy1qcy5qcyIsIm1hcHBpbmdzIjoiOztBQUFBLGtCQUFlLEVBQUUsQ0FBQSIsIm5hbWVzIjpbXSwic291cmNlcyI6WyJ0ZXN0LWFsbG93LWpzLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IDQyIl0sInZlcnNpb24iOjN9
27
- ===[ INLINE SOURCE MAPS ]=======================================================
28
- file: test-allow-js.js
29
- mappings: ';;AAAA,kBAAe,EAAE,CAAA'
30
- names: []
31
- sources:
32
- - test-allow-js.js
33
- sourcesContent:
34
- - export default 42
35
- version: 3
36
- ================================================================================
11
+ "\\ "use strict\\ ";
12
+ Object.defineProperty(exports, \\ "__esModule\\ ", { value : true } );
13
+ exports.default = 42;
14
+ //# "
37
15
` ;
38
16
39
17
exports [` TsCompiler isolatedModule false diagnostics should throw error when cannot compile 1` ] = `
@@ -55,131 +33,54 @@ Array [
55
33
` ;
56
34
57
35
exports [` TsCompiler isolatedModule false jsx option should compile tsx file for jsx preserve 1` ] = `
58
- ===[ FILE: test-jsx.tsx ]=======================================================
59
- "use strict";
60
- const App = () => {
61
- return <> Test < / > ;
62
- } ;
63
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoidGVzdC1qc3gudHN4IiwibWFwcGluZ3MiOiI7QUFDUSxNQUFNLEdBQUcsR0FBRyxHQUFHLEVBQUU7SUFDZixPQUFPLEVBQUUsSUFBSSxHQUFHLENBQUE7QUFDbEIsQ0FBQyxDQUFBIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbInRlc3QtanN4LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJcbiAgICAgICAgY29uc3QgQXBwID0gKCkgPT4ge1xuICAgICAgICAgIHJldHVybiA8PlRlc3Q8Lz5cbiAgICAgICAgfVxuICAgICAgIl0sInZlcnNpb24iOjN9
64
- ===[ INLINE SOURCE MAPS ]=======================================================
65
- file: test-jsx.tsx
66
- mappings: ';AACQ,MAAM,GAAG,GAAG,GAAG,EAAE;IACf,OAAO,EAAE,IAAI,GAAG,CAAA;AAClB,CAAC,CAAA'
67
- names: []
68
- sources:
69
- - test-jsx.tsx
70
- sourcesContent:
71
- - |2-
72
-
73
- const App = () => {
74
- return <> Test < / >
75
- }
76
-
77
- version: 3
78
- ================================================================================
36
+ "\\ "use strict\\ ";
37
+ const App = () => {
38
+ return <> Test < / > ;
39
+ } ;
40
+ //# "
79
41
` ;
80
42
81
43
exports [` TsCompiler isolatedModule false jsx option should compile tsx file for other jsx options 1` ] = `
82
- ===[ FILE: test-jsx.tsx ]=======================================================
83
- "use strict";
84
- const App = () => {
85
- return React .createElement (React .Fragment , null , " Test" );
86
- } ;
87
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoidGVzdC1qc3gudHN4IiwibWFwcGluZ3MiOiI7QUFDUSxNQUFNLEdBQUcsR0FBRyxHQUFHLEVBQUU7SUFDZixPQUFPLGlEQUFTLENBQUE7QUFDbEIsQ0FBQyxDQUFBIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbInRlc3QtanN4LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJcbiAgICAgICAgY29uc3QgQXBwID0gKCkgPT4ge1xuICAgICAgICAgIHJldHVybiA8PlRlc3Q8Lz5cbiAgICAgICAgfVxuICAgICAgIl0sInZlcnNpb24iOjN9
88
- ===[ INLINE SOURCE MAPS ]=======================================================
89
- file: test-jsx.tsx
90
- mappings: ';AACQ,MAAM,GAAG,GAAG,GAAG,EAAE;IACf,OAAO,iDAAS,CAAA;AAClB,CAAC,CAAA'
91
- names: []
92
- sources:
93
- - test-jsx.tsx
94
- sourcesContent:
95
- - |2-
96
-
97
- const App = () => {
98
- return <> Test < / >
99
- }
100
-
101
- version: 3
102
- ================================================================================
44
+ "\\ "use strict\\ ";
45
+ const App = () => {
46
+ return React .createElement (React .Fragment , null , \\" Test\\ " );
47
+ } ;
48
+ //# "
49
+ ` ;
50
+
51
+ exports [` TsCompiler isolatedModule false should compile codes with useESM true 1` ] = `
52
+ "export const thing = { a : 1 , b : 2 } ;
53
+ //# "
103
54
` ;
104
55
105
56
exports [` TsCompiler isolatedModule true diagnostics should report diagnostics related to codes with pathRegex config is undefined 1` ] = ` "foo.ts(2,23): error TS1005: '=>' expected."` ;
106
57
107
58
exports [` TsCompiler isolatedModule true diagnostics should report diagnostics related to codes with pathRegex config matches file name 1` ] = ` "foo.ts(2,23): error TS1005: '=>' expected."` ;
108
59
109
60
exports [` TsCompiler isolatedModule true jsx option should compile tsx file for jsx preserve 1` ] = `
110
- ===[ FILE: foo.tsx ]============================================================
111
- "use strict";
112
- const App = () => {
113
- return <> Test < / > ;
114
- } ;
115
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoiZm9vLnRzeCIsIm1hcHBpbmdzIjoiO0FBQ1EsTUFBTSxHQUFHLEdBQUcsR0FBRyxFQUFFO0lBQ2YsT0FBTyxFQUFFLElBQUksR0FBRyxDQUFBO0FBQ2xCLENBQUMsQ0FBQSIsIm5hbWVzIjpbXSwic291cmNlcyI6WyJmb28udHN4Il0sInNvdXJjZXNDb250ZW50IjpbIlxuICAgICAgICBjb25zdCBBcHAgPSAoKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIDw+VGVzdDwvPlxuICAgICAgICB9XG4gICAgICAiXSwidmVyc2lvbiI6M30=
116
- ===[ INLINE SOURCE MAPS ]=======================================================
117
- file: foo.tsx
118
- mappings: ';AACQ,MAAM,GAAG,GAAG,GAAG,EAAE;IACf,OAAO,EAAE,IAAI,GAAG,CAAA;AAClB,CAAC,CAAA'
119
- names: []
120
- sources:
121
- - foo.tsx
122
- sourcesContent:
123
- - |2-
124
-
125
- const App = () => {
126
- return <> Test < / >
127
- }
128
-
129
- version: 3
130
- ================================================================================
61
+ "\\ "use strict\\ ";
62
+ const App = () => {
63
+ return <> Test < / > ;
64
+ } ;
65
+ //# "
131
66
` ;
132
67
133
68
exports [` TsCompiler isolatedModule true jsx option should compile tsx file for other jsx options 1` ] = `
134
- ===[ FILE: foo.tsx ]============================================================
135
- "use strict";
136
- const App = () => {
137
- return React .createElement (React .Fragment , null , " Test" );
138
- } ;
139
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoiZm9vLnRzeCIsIm1hcHBpbmdzIjoiO0FBQ1EsTUFBTSxHQUFHLEdBQUcsR0FBRyxFQUFFO0lBQ2YsT0FBTyxpREFBUyxDQUFBO0FBQ2xCLENBQUMsQ0FBQSIsIm5hbWVzIjpbXSwic291cmNlcyI6WyJmb28udHN4Il0sInNvdXJjZXNDb250ZW50IjpbIlxuICAgICAgICBjb25zdCBBcHAgPSAoKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIDw+VGVzdDwvPlxuICAgICAgICB9XG4gICAgICAiXSwidmVyc2lvbiI6M30=
140
- ===[ INLINE SOURCE MAPS ]=======================================================
141
- file: foo.tsx
142
- mappings: ';AACQ,MAAM,GAAG,GAAG,GAAG,EAAE;IACf,OAAO,iDAAS,CAAA;AAClB,CAAC,CAAA'
143
- names: []
144
- sources:
145
- - foo.tsx
146
- sourcesContent:
147
- - |2-
148
-
149
- const App = () => {
150
- return <> Test < / >
151
- }
152
-
153
- version: 3
154
- ================================================================================
69
+ "\\ "use strict\\ ";
70
+ const App = () => {
71
+ return React .createElement (React .Fragment , null , \\" Test\\ " );
72
+ } ;
73
+ //# "
155
74
` ;
156
75
157
76
exports [` TsCompiler isolatedModule true should compile js file for allowJs true 1` ] = `
158
- ===[ FILE: foo.js ]=============================================================
159
- "use strict";
160
- Object.defineProperty(exports, "__esModule", { value : true } );
161
- exports.default = 42;
162
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJmaWxlIjoiZm9vLmpzIiwibWFwcGluZ3MiOiI7O0FBQUEsa0JBQWUsRUFBRSxDQUFBIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbImZvby5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCA0MiJdLCJ2ZXJzaW9uIjozfQ==
163
- ===[ INLINE SOURCE MAPS ]=======================================================
164
- file: foo.js
165
- mappings: ';;AAAA,kBAAe,EAAE,CAAA'
166
- names: []
167
- sources:
168
- - foo.js
169
- sourcesContent:
170
- - export default 42
171
- version: 3
172
- ================================================================================
77
+ "\\ "use strict\\ ";
78
+ Object.defineProperty(exports, \\ "__esModule\\ ", { value : true } );
79
+ exports.default = 42;
80
+ //# "
173
81
` ;
174
82
175
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 1` ] = ` 99` ;
176
-
177
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 2` ] = ` 99` ;
178
-
179
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 3` ] = ` 99` ;
180
-
181
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 4` ] = ` 1` ;
182
-
183
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 5` ] = ` 1` ;
184
-
185
- exports [` TsCompiler isolatedModule true support ESM should transpile codes to correct syntax with supportsStaticESM and useESM options 6` ] = ` 1` ;
83
+ exports [` TsCompiler isolatedModule true should transpile code with useESM true 1` ] = `
84
+ "export const thing = { a : 1 , b : 2 } ;
85
+ //# "
86
+ ` ;
0 commit comments