Extra tests in preparation for lazy signature making sure the origina… · microsoft/TypeScript@925e70e (original) (raw)
`` @@ -264,6 +264,11 @@ const a: string = 10;`, "utf-8"),
``
264
264
`buildKind: BuildKind.IncrementalDtsChange,
`
265
265
`` modifyFs: fs => appendText(fs, /src/project/src/main.ts
, something();
),
``
266
266
`},
`
``
267
`+
{
`
``
268
`+
subScenario: "Modify main file again",
`
``
269
`+
buildKind: BuildKind.IncrementalDtsChange,
`
``
270
`` +
modifyFs: fs => appendText(fs, /src/project/src/main.ts
, something();
),
``
``
271
`+
},
`
267
272
`{
`
268
273
`subScenario: "Add new file and update main file",
`
269
274
`buildKind: BuildKind.IncrementalDtsChange,
`
`` @@ -288,7 +293,9 @@ const a: string = 10;`, "utf-8"),
``
288
293
`baselinePrograms: true,
`
289
294
`});
`
290
295
``
291
``
`` -
const jsxLibraryContent = `
``
``
296
`+
describe("when synthesized imports are added to files", () => {
`
``
297
`+
function getJsxLibraryContent() {
`
``
298
`` +
return `
``
292
299
`export {};
`
293
300
`declare global {
`
294
301
` namespace JSX {
`
`@@ -300,29 +307,31 @@ declare global {
`
300
307
` }
`
301
308
` }
`
302
309
`` }`;
``
``
310
`+
}
`
303
311
``
304
``
`-
verifyTsc({
`
305
``
`-
scenario: "react-jsx-emit-mode",
`
306
``
`-
subScenario: "with no backing types found doesn't crash",
`
307
``
`-
fs: () => loadProjectFromFiles({
`
308
``
`-
"/src/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result
`
309
``
`-
"/src/project/node_modules/@types/react/index.d.ts": jsxLibraryContent, // doesn't contain a jsx-runtime definition
`
310
``
`` -
"/src/project/src/index.tsx": export const App = () => <div propA={true}></div>;
,
``
311
``
`-
"/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { module: "commonjs", jsx: "react-jsx", incremental: true, jsxImportSource: "react" } })
`
312
``
`-
}),
`
313
``
`-
commandLineArgs: ["--p", "src/project"]
`
314
``
`-
});
`
``
312
`+
verifyTsc({
`
``
313
`+
scenario: "react-jsx-emit-mode",
`
``
314
`+
subScenario: "with no backing types found doesn't crash",
`
``
315
`+
fs: () => loadProjectFromFiles({
`
``
316
`+
"/src/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result
`
``
317
`+
"/src/project/node_modules/@types/react/index.d.ts": getJsxLibraryContent(), // doesn't contain a jsx-runtime definition
`
``
318
`` +
"/src/project/src/index.tsx": export const App = () => <div propA={true}></div>;
,
``
``
319
`+
"/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { module: "commonjs", jsx: "react-jsx", incremental: true, jsxImportSource: "react" } })
`
``
320
`+
}),
`
``
321
`+
commandLineArgs: ["--p", "src/project"]
`
``
322
`+
});
`
315
323
``
316
``
`-
verifyTsc({
`
317
``
`-
scenario: "react-jsx-emit-mode",
`
318
``
`-
subScenario: "with no backing types found doesn't crash under --strict",
`
319
``
`-
fs: () => loadProjectFromFiles({
`
320
``
`-
"/src/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result
`
321
``
`-
"/src/project/node_modules/@types/react/index.d.ts": jsxLibraryContent, // doesn't contain a jsx-runtime definition
`
322
``
`` -
"/src/project/src/index.tsx": export const App = () => <div propA={true}></div>;
,
``
323
``
`-
"/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { module: "commonjs", jsx: "react-jsx", incremental: true, jsxImportSource: "react" } })
`
324
``
`-
}),
`
325
``
`-
commandLineArgs: ["--p", "src/project", "--strict"]
`
``
324
`+
verifyTsc({
`
``
325
`+
scenario: "react-jsx-emit-mode",
`
``
326
`+
subScenario: "with no backing types found doesn't crash under --strict",
`
``
327
`+
fs: () => loadProjectFromFiles({
`
``
328
`+
"/src/project/node_modules/react/jsx-runtime.js": "export {}", // js needs to be present so there's a resolution result
`
``
329
`+
"/src/project/node_modules/@types/react/index.d.ts": getJsxLibraryContent(), // doesn't contain a jsx-runtime definition
`
``
330
`` +
"/src/project/src/index.tsx": export const App = () => <div propA={true}></div>;
,
``
``
331
`+
"/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { module: "commonjs", jsx: "react-jsx", incremental: true, jsxImportSource: "react" } })
`
``
332
`+
}),
`
``
333
`+
commandLineArgs: ["--p", "src/project", "--strict"]
`
``
334
`+
});
`
326
335
`});
`
327
336
`});
`
328
337
`}
`