diff options
Diffstat (limited to 'tests/specs')
-rw-r--r-- | tests/specs/npm/cjs_import_dual/__test__.jsonc | 13 | ||||
-rw-r--r-- | tests/specs/npm/cjs_import_dual/check.out | 9 | ||||
-rw-r--r-- | tests/specs/npm/cjs_import_dual/main.ts | 4 | ||||
-rw-r--r-- | tests/specs/npm/cjs_import_dual/run.out | 5 |
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/specs/npm/cjs_import_dual/__test__.jsonc b/tests/specs/npm/cjs_import_dual/__test__.jsonc new file mode 100644 index 000000000..83fbd15cc --- /dev/null +++ b/tests/specs/npm/cjs_import_dual/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "tests": { + "run": { + "args": "run main.ts", + "output": "run.out" + }, + "check": { + "args": "check --all main.ts", + "exitCode": 1, + "output": "check.out" + } + } +} diff --git a/tests/specs/npm/cjs_import_dual/check.out b/tests/specs/npm/cjs_import_dual/check.out new file mode 100644 index 000000000..be1fe86a6 --- /dev/null +++ b/tests/specs/npm/cjs_import_dual/check.out @@ -0,0 +1,9 @@ +Download http://localhost:4260/@denotest/cjs-import-dual +Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Check file:///[WILDLINE]/cjs_import_dual/main.ts +error: TS2322 [ERROR]: Type '"cjs"' is not assignable to type '"esm"'. +const kind: "esm" = getKind(); // should cause a type error + ~~~~ + at file:///[WILDLINE]/cjs_import_dual/main.ts:3:7 diff --git a/tests/specs/npm/cjs_import_dual/main.ts b/tests/specs/npm/cjs_import_dual/main.ts new file mode 100644 index 000000000..1a1bd4aed --- /dev/null +++ b/tests/specs/npm/cjs_import_dual/main.ts @@ -0,0 +1,4 @@ +import { getKind } from "npm:@denotest/cjs-import-dual@1"; + +const kind: "esm" = getKind(); // should cause a type error +console.log(kind); diff --git a/tests/specs/npm/cjs_import_dual/run.out b/tests/specs/npm/cjs_import_dual/run.out new file mode 100644 index 000000000..2c05e125e --- /dev/null +++ b/tests/specs/npm/cjs_import_dual/run.out @@ -0,0 +1,5 @@ +Download http://localhost:4260/@denotest/cjs-import-dual +Download http://localhost:4260/@denotest/dual-cjs-esm +Download http://localhost:4260/@denotest/cjs-import-dual/1.0.0.tgz +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +cjs |