summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/registry/@denotest
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata/npm/registry/@denotest')
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.d.ts6
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.js6
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/package.json5
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/index.d.ts6
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/package.json3
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/esm-import-cjs-default/1.0.0/package.json1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.d.ts13
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js1
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json3
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.d.ts10
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.js3
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/package.json5
12 files changed, 60 insertions, 2 deletions
diff --git a/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.d.ts b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.d.ts
new file mode 100644
index 000000000..673c0035e
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.d.ts
@@ -0,0 +1,6 @@
+// intentional type checking errors
+export class Class1 extends Class2 {
+}
+
+export class Class2 extends Class1 {
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.js
new file mode 100644
index 000000000..7eb6b784d
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/index.js
@@ -0,0 +1,6 @@
+module.exports = {
+ Class1: class {
+ },
+ Class2: class {
+ },
+};
diff --git a/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/package.json
new file mode 100644
index 000000000..295920a8f
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/check-error/1.0.0/package.json
@@ -0,0 +1,5 @@
+{
+ "name": "@denotest/check-error",
+ "version": "1.0.0",
+ "types": "./index.d.ts"
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/index.d.ts b/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/index.d.ts
new file mode 100644
index 000000000..90fdfe5f6
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/index.d.ts
@@ -0,0 +1,6 @@
+export default function (): number;
+export declare function named(): number;
+declare class MyClass {
+ static someStaticMethod(): string;
+}
+export { MyClass };
diff --git a/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/package.json
index 4765d25d2..8da28b919 100644
--- a/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/cjs-default-export/1.0.0/package.json
@@ -1,4 +1,5 @@
{
"name": "@denotest/cjs-default-export",
- "version": "1.0.0"
+ "version": "1.0.0",
+ "types": "./index.d.ts"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/esm-import-cjs-default/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/esm-import-cjs-default/1.0.0/package.json
index 184076799..f757a08fb 100644
--- a/cli/tests/testdata/npm/registry/@denotest/esm-import-cjs-default/1.0.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/esm-import-cjs-default/1.0.0/package.json
@@ -1,6 +1,7 @@
{
"name": "@denotest/esm-import-cjs-default",
"version": "1.0.0",
+ "main": "index.mjs",
"dependencies": {
"@denotest/cjs-default-export": "^1.0.0"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.d.ts b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.d.ts
new file mode 100644
index 000000000..ee03712dd
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.d.ts
@@ -0,0 +1,13 @@
+declare const tempGlobalThis: typeof globalThis;
+declare const tempGlobal: typeof global;
+declare const tempProcess: typeof process;
+export {
+ tempGlobalThis as globalThis,
+ tempGlobal as global,
+ tempProcess as process,
+};
+
+type AssertTrue<T extends true> = never;
+type _TestHasProcessGlobal = AssertTrue<
+ typeof globalThis extends { process: any } ? true : false
+>;
diff --git a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
index be5e6e5ac..50d2d3d2a 100644
--- a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
+++ b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
@@ -1,2 +1,3 @@
exports.globalThis = globalThis;
exports.global = global;
+exports.process = process;
diff --git a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
index cba0742c1..1ce42ded4 100644
--- a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
@@ -1,4 +1,5 @@
{
"name": "@denotest/globals",
- "version": "1.0.0"
+ "version": "1.0.0",
+ "types": "index.d.ts"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.d.ts b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.d.ts
new file mode 100644
index 000000000..fc2199884
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.d.ts
@@ -0,0 +1,10 @@
+// Some packages do this. It's really not ideal because instead of allowing
+// the package to be resolved at any specifier, it instead expects the package
+// to be resolved via a "@denotest/types-ambient" specifier. To make this work,
+// we've currently modified the typescript compiler to check for any "<package-name>"
+// ambient modules when resolving an npm specifier at "npm:<package-name>"
+declare module "@denotest/types-ambient" {
+ class Test {
+ prop: number;
+ }
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.js
new file mode 100644
index 000000000..47ff7adb2
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/index.js
@@ -0,0 +1,3 @@
+export class Test {
+ prop = 5;
+}
diff --git a/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/package.json
new file mode 100644
index 000000000..ef927cbe3
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/types-ambient/1.0.0/package.json
@@ -0,0 +1,5 @@
+{
+ "name": "@denotest/types-ambient",
+ "version": "1.0.0",
+ "types": "./index.d.ts"
+}