-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add allowJs and declaration emit enabled tests
- Loading branch information
Showing
129 changed files
with
4,023 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
tests/baselines/reference/nodeModulesAllowJs1(module=node12).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// | ||
|
||
//// [index.js] | ||
// cjs format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// cjs format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export {x}; | ||
//// [package.json] | ||
{ | ||
"name": "package", | ||
"private": true, | ||
"type": "module" | ||
} | ||
//// [package.json] | ||
{ | ||
"type": "commonjs" | ||
} | ||
//// [package.json] | ||
{ | ||
} | ||
//// [package.json] | ||
{ | ||
"type": "module" | ||
} | ||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.x = void 0; | ||
// cjs format file | ||
const x = 1; | ||
exports.x = x; | ||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.x = void 0; | ||
// cjs format file | ||
const x = 1; | ||
exports.x = x; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export { x }; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export { x }; | ||
|
||
|
||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; |
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/nodeModulesAllowJs1(module=node12).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
=== tests/cases/conformance/node/allowJs/subfolder/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/nodeModulesAllowJs1(module=node12).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/conformance/node/allowJs/subfolder/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
68 changes: 68 additions & 0 deletions
68
tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// | ||
|
||
//// [index.js] | ||
// cjs format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// cjs format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export {x}; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export {x}; | ||
//// [package.json] | ||
{ | ||
"name": "package", | ||
"private": true, | ||
"type": "module" | ||
} | ||
//// [package.json] | ||
{ | ||
"type": "commonjs" | ||
} | ||
//// [package.json] | ||
{ | ||
} | ||
//// [package.json] | ||
{ | ||
"type": "module" | ||
} | ||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.x = void 0; | ||
// cjs format file | ||
const x = 1; | ||
exports.x = x; | ||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.x = void 0; | ||
// cjs format file | ||
const x = 1; | ||
exports.x = x; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export { x }; | ||
//// [index.js] | ||
// esm format file | ||
const x = 1; | ||
export { x }; | ||
|
||
|
||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; | ||
//// [index.d.ts] | ||
export const x: 1; |
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
=== tests/cases/conformance/node/allowJs/subfolder/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
||
=== tests/cases/conformance/node/allowJs/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : Symbol(x, Decl(index.js, 1, 5)) | ||
|
||
export {x}; | ||
>x : Symbol(x, Decl(index.js, 2, 8)) | ||
|
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/conformance/node/allowJs/subfolder/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/index.js === | ||
// cjs format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
||
=== tests/cases/conformance/node/allowJs/index.js === | ||
// esm format file | ||
const x = 1; | ||
>x : 1 | ||
>1 : 1 | ||
|
||
export {x}; | ||
>x : 1 | ||
|
45 changes: 45 additions & 0 deletions
45
tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// | ||
|
||
//// [index.js] | ||
// cjs format file | ||
export async function main() { | ||
const { readFile } = await import("fs"); | ||
} | ||
//// [index.js] | ||
// esm format file | ||
export async function main() { | ||
const { readFile } = await import("fs"); | ||
} | ||
//// [package.json] | ||
{ | ||
"name": "package", | ||
"private": true, | ||
"type": "module" | ||
} | ||
//// [package.json] | ||
{ | ||
"type": "commonjs" | ||
} | ||
//// [types.d.ts] | ||
declare module "fs"; | ||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.main = void 0; | ||
// cjs format file | ||
async function main() { | ||
const { readFile } = await import("fs"); | ||
} | ||
exports.main = main; | ||
//// [index.js] | ||
// esm format file | ||
export async function main() { | ||
const { readFile } = await import("fs"); | ||
} | ||
|
||
|
||
//// [index.d.ts] | ||
export function main(): Promise<void>; | ||
//// [index.d.ts] | ||
export function main(): Promise<void>; |
Oops, something went wrong.