diff options
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r-- | cli/tests/testdata/034_onload/imported.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/034_onload/main.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/034_onload/nest_imported.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/058_tasks_microtasks_close.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/import_type.ts | 5 | ||||
-rw-r--r-- | cli/tests/testdata/import_type.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/testdata/lsp/a.d.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/lsp/b.d.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/mts_dmts_mjs.out | 2 | ||||
-rw-r--r-- | cli/tests/testdata/private_field_presence.ts | 20 | ||||
-rw-r--r-- | cli/tests/testdata/private_field_presence.ts.out | 3 | ||||
-rw-r--r-- | cli/tests/testdata/subdir/export_types.ts | 11 | ||||
-rw-r--r-- | cli/tests/testdata/subdir/import.mts | 4 | ||||
-rw-r--r-- | cli/tests/testdata/subdir/mod.mjs | 1 | ||||
-rw-r--r-- | cli/tests/testdata/subdir/types.d.mts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/subdir/types.d.ts | 1 |
16 files changed, 56 insertions, 0 deletions
diff --git a/cli/tests/testdata/034_onload/imported.ts b/cli/tests/testdata/034_onload/imported.ts index bac6cf5fa..a176d4200 100644 --- a/cli/tests/testdata/034_onload/imported.ts +++ b/cli/tests/testdata/034_onload/imported.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file no-window-prefix import { assert } from "../../../../test_util/std/testing/asserts.ts"; import "./nest_imported.ts"; diff --git a/cli/tests/testdata/034_onload/main.ts b/cli/tests/testdata/034_onload/main.ts index 42df21c16..df6713105 100644 --- a/cli/tests/testdata/034_onload/main.ts +++ b/cli/tests/testdata/034_onload/main.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file no-window-prefix no-prototype-builtins import { assert } from "../../../../test_util/std/testing/asserts.ts"; import "./imported.ts"; diff --git a/cli/tests/testdata/034_onload/nest_imported.ts b/cli/tests/testdata/034_onload/nest_imported.ts index 259e505a2..e461dd9b1 100644 --- a/cli/tests/testdata/034_onload/nest_imported.ts +++ b/cli/tests/testdata/034_onload/nest_imported.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file no-window-prefix import { assert } from "../../../../test_util/std/testing/asserts.ts"; const handler = (e: Event) => { diff --git a/cli/tests/testdata/058_tasks_microtasks_close.ts b/cli/tests/testdata/058_tasks_microtasks_close.ts index 11de55a38..38e156044 100644 --- a/cli/tests/testdata/058_tasks_microtasks_close.ts +++ b/cli/tests/testdata/058_tasks_microtasks_close.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file no-window-prefix console.log("sync 1"); setTimeout(() => { console.log("setTimeout 1"); diff --git a/cli/tests/testdata/import_type.ts b/cli/tests/testdata/import_type.ts new file mode 100644 index 000000000..851ebad86 --- /dev/null +++ b/cli/tests/testdata/import_type.ts @@ -0,0 +1,5 @@ +import { type B, create } from "./subdir/export_types.ts"; + +const b: B = create(); + +console.log(b); diff --git a/cli/tests/testdata/import_type.ts.out b/cli/tests/testdata/import_type.ts.out new file mode 100644 index 000000000..188c5e25d --- /dev/null +++ b/cli/tests/testdata/import_type.ts.out @@ -0,0 +1,2 @@ +[WILDCARD] +B { a: "a" } diff --git a/cli/tests/testdata/lsp/a.d.ts b/cli/tests/testdata/lsp/a.d.ts index 7f587e144..536a6d0a6 100644 --- a/cli/tests/testdata/lsp/a.d.ts +++ b/cli/tests/testdata/lsp/a.d.ts @@ -1 +1,2 @@ +// deno-lint-ignore-file no-var declare var a: string; diff --git a/cli/tests/testdata/lsp/b.d.ts b/cli/tests/testdata/lsp/b.d.ts index 9d4b96cb8..2fd56623b 100644 --- a/cli/tests/testdata/lsp/b.d.ts +++ b/cli/tests/testdata/lsp/b.d.ts @@ -1 +1,2 @@ +// deno-lint-ignore-file no-var declare var b: string; diff --git a/cli/tests/testdata/mts_dmts_mjs.out b/cli/tests/testdata/mts_dmts_mjs.out new file mode 100644 index 000000000..5647bdfb9 --- /dev/null +++ b/cli/tests/testdata/mts_dmts_mjs.out @@ -0,0 +1,2 @@ +[WILDCARD] +a diff --git a/cli/tests/testdata/private_field_presence.ts b/cli/tests/testdata/private_field_presence.ts new file mode 100644 index 000000000..7ce2840d8 --- /dev/null +++ b/cli/tests/testdata/private_field_presence.ts @@ -0,0 +1,20 @@ +export class Person { + #name: string; + constructor(name: string) { + this.#name = name; + } + + equals(other: unknown) { + return other && + typeof other === "object" && + #name in other && + this.#name === other.#name; + } +} + +const a = new Person("alice"); +const b = new Person("bob"); +const c = new Person("alice"); + +console.log(a.equals(b)); +console.log(a.equals(c)); diff --git a/cli/tests/testdata/private_field_presence.ts.out b/cli/tests/testdata/private_field_presence.ts.out new file mode 100644 index 000000000..f582fb47a --- /dev/null +++ b/cli/tests/testdata/private_field_presence.ts.out @@ -0,0 +1,3 @@ +[WILDCARD] +false +true diff --git a/cli/tests/testdata/subdir/export_types.ts b/cli/tests/testdata/subdir/export_types.ts new file mode 100644 index 000000000..18c8ed881 --- /dev/null +++ b/cli/tests/testdata/subdir/export_types.ts @@ -0,0 +1,11 @@ +export interface A { + a: string; +} + +export class B implements A { + a = "a"; +} + +export function create(): B { + return new B(); +} diff --git a/cli/tests/testdata/subdir/import.mts b/cli/tests/testdata/subdir/import.mts new file mode 100644 index 000000000..eeb200f59 --- /dev/null +++ b/cli/tests/testdata/subdir/import.mts @@ -0,0 +1,4 @@ +import * as a from "./mod.mjs"; +import { type A } from "./types.d.mts"; + +console.log(a.a as A); diff --git a/cli/tests/testdata/subdir/mod.mjs b/cli/tests/testdata/subdir/mod.mjs new file mode 100644 index 000000000..9233cce2f --- /dev/null +++ b/cli/tests/testdata/subdir/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/cli/tests/testdata/subdir/types.d.mts b/cli/tests/testdata/subdir/types.d.mts new file mode 100644 index 000000000..28c282146 --- /dev/null +++ b/cli/tests/testdata/subdir/types.d.mts @@ -0,0 +1 @@ +export type A = "a"; diff --git a/cli/tests/testdata/subdir/types.d.ts b/cli/tests/testdata/subdir/types.d.ts index 7f587e144..536a6d0a6 100644 --- a/cli/tests/testdata/subdir/types.d.ts +++ b/cli/tests/testdata/subdir/types.d.ts @@ -1 +1,2 @@ +// deno-lint-ignore-file no-var declare var a: string; |