diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2022-10-21 11:20:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-21 15:20:18 +0000 |
| commit | bcfe279fba865763c87f9cd8d5a2d0b2cbf451be (patch) | |
| tree | 68e4d1bc52e261df50279f9ecea14795d1c46f6c /cli/tests/testdata/npm/compare_globals | |
| parent | 0e1a71fec6fff5fe62d7e6b2bfffb7ab877d7b71 (diff) | |
feat(unstable/npm): initial type checking of npm specifiers (#16332)
Diffstat (limited to 'cli/tests/testdata/npm/compare_globals')
| -rw-r--r-- | cli/tests/testdata/npm/compare_globals/main.js | 2 | ||||
| -rw-r--r-- | cli/tests/testdata/npm/compare_globals/main.out | 5 | ||||
| -rw-r--r-- | cli/tests/testdata/npm/compare_globals/main.ts | 14 |
3 files changed, 19 insertions, 2 deletions
diff --git a/cli/tests/testdata/npm/compare_globals/main.js b/cli/tests/testdata/npm/compare_globals/main.js deleted file mode 100644 index ce43e32b1..000000000 --- a/cli/tests/testdata/npm/compare_globals/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import * as globals from "npm:@denotest/globals"; -console.log(globals.global === globals.globalThis); diff --git a/cli/tests/testdata/npm/compare_globals/main.out b/cli/tests/testdata/npm/compare_globals/main.out index a1a5c0e8f..1b22fd318 100644 --- a/cli/tests/testdata/npm/compare_globals/main.out +++ b/cli/tests/testdata/npm/compare_globals/main.out @@ -1,3 +1,8 @@ Download http://localhost:4545/npm/registry/@denotest/globals +Download http://localhost:4545/npm/registry/@types/node Download http://localhost:4545/npm/registry/@denotest/globals/1.0.0.tgz +Download http://localhost:4545/npm/registry/@types/node/node-18.8.2.tgz +Check file:///[WILDCARD]/npm/compare_globals/main.ts +Check file:///[WILDCARD]/std/node/module_all.ts true +[] diff --git a/cli/tests/testdata/npm/compare_globals/main.ts b/cli/tests/testdata/npm/compare_globals/main.ts new file mode 100644 index 000000000..5710d0bd5 --- /dev/null +++ b/cli/tests/testdata/npm/compare_globals/main.ts @@ -0,0 +1,14 @@ +/// <reference types="npm:@types/node" /> + +import * as globals from "npm:@denotest/globals"; +console.log(globals.global === globals.globalThis); +console.log(globals.process.execArgv); + +type AssertTrue<T extends true> = never; +type _TestNoProcessGlobal = AssertTrue< + typeof globalThis extends { process: any } ? false : true +>; +type _TestHasNodeJsGlobal = NodeJS.Architecture; + +const controller = new AbortController(); +controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason |
