/
ts-compiler.spec.ts.snap
86 lines (73 loc) · 2.88 KB
/
ts-compiler.spec.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`TsCompiler isolatedModule false allowJs option should compile js file for allowJs true with outDir 1`] = `
"\\"use strict\\";
Object.defineProperty(exports, \\"__esModule\\", { value: true });
exports.default = 42;
//# "
`;
exports[`TsCompiler isolatedModule false allowJs option should compile js file for allowJs true without outDir 1`] = `
"\\"use strict\\";
Object.defineProperty(exports, \\"__esModule\\", { value: true });
exports.default = 42;
//# "
`;
exports[`TsCompiler isolatedModule false diagnostics should throw error when cannot compile 1`] = `
"Unable to require \`.d.ts\` file for file: test-cannot-compile.d.ts.
This is usually the result of a faulty configuration or import. Make sure there is a \`.js\`, \`.json\` or another executable extension available alongside \`test-cannot-compile.d.ts\`."
`;
exports[`TsCompiler isolatedModule false diagnostics shouldn't report diagnostic when processing file isn't used by any test files 1`] = `
Array [
"[level:20] getCompiledOutput(): compiling using language service
",
"[level:20] updateMemoryCache: update memory cache for language service
",
"[level:20] visitSourceFileNode(): hoisting
",
"[level:20] getCompiledOutput(): computing diagnostics using language service
",
]
`;
exports[`TsCompiler isolatedModule false jsx option should compile tsx file for jsx preserve 1`] = `
"\\"use strict\\";
const App = () => {
return <>Test</>;
};
//# "
`;
exports[`TsCompiler isolatedModule false jsx option should compile tsx file for other jsx options 1`] = `
"\\"use strict\\";
const App = () => {
return React.createElement(React.Fragment, null, \\"Test\\");
};
//# "
`;
exports[`TsCompiler isolatedModule false should compile codes with useESM true 1`] = `
"export const thing = { a: 1, b: 2 };
//# "
`;
exports[`TsCompiler isolatedModule true diagnostics should report diagnostics related to codes with exclude config is undefined 1`] = `"foo.ts(2,23): error TS1005: '=>' expected."`;
exports[`TsCompiler isolatedModule true diagnostics should report diagnostics related to codes with exclude config matches file name 1`] = `"foo.ts(2,23): error TS1005: '=>' expected."`;
exports[`TsCompiler isolatedModule true jsx option should compile tsx file for jsx preserve 1`] = `
"\\"use strict\\";
const App = () => {
return <>Test</>;
};
//# "
`;
exports[`TsCompiler isolatedModule true jsx option should compile tsx file for other jsx options 1`] = `
"\\"use strict\\";
const App = () => {
return React.createElement(React.Fragment, null, \\"Test\\");
};
//# "
`;
exports[`TsCompiler isolatedModule true should compile js file for allowJs true 1`] = `
"\\"use strict\\";
Object.defineProperty(exports, \\"__esModule\\", { value: true });
exports.default = 42;
//# "
`;
exports[`TsCompiler isolatedModule true should transpile code with useESM true 1`] = `
"export const thing = { a: 1, b: 2 };
//# "
`;