de23842e45
* Allow import assertions on esm imports under module: nodenext * Changes to copy Co-authored-by: Andrew Branch <andrew@wheream.io>
26 lines
989 B
Plaintext
26 lines
989 B
Plaintext
=== tests/cases/conformance/node/index.ts ===
|
|
import json from "./package.json" assert { type: "json" };
|
|
>json : Symbol(json, Decl(index.ts, 0, 6))
|
|
|
|
=== tests/cases/conformance/node/otherc.cts ===
|
|
import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions
|
|
>json : Symbol(json, Decl(otherc.cts, 0, 6))
|
|
|
|
const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine
|
|
>json2 : Symbol(json2, Decl(otherc.cts, 1, 5))
|
|
>"./package.json" : Symbol("tests/cases/conformance/node/package", Decl(package.json, 0, 0))
|
|
>assert : Symbol(assert, Decl(otherc.cts, 1, 40))
|
|
>type : Symbol(type, Decl(otherc.cts, 1, 50))
|
|
|
|
=== tests/cases/conformance/node/package.json ===
|
|
{
|
|
"name": "pkg",
|
|
>"name" : Symbol("name", Decl(package.json, 0, 1))
|
|
|
|
"private": true,
|
|
>"private" : Symbol("private", Decl(package.json, 1, 18))
|
|
|
|
"type": "module"
|
|
>"type" : Symbol("type", Decl(package.json, 2, 20))
|
|
}
|