diff options
Diffstat (limited to 'tests/testdata/subdir')
73 files changed, 267 insertions, 0 deletions
diff --git a/tests/testdata/subdir/CAPITALS/main.js b/tests/testdata/subdir/CAPITALS/main.js new file mode 100644 index 000000000..768d1391f --- /dev/null +++ b/tests/testdata/subdir/CAPITALS/main.js @@ -0,0 +1,3 @@ +export function returnsUppperHi() { + return "HI"; +} diff --git a/tests/testdata/subdir/amd_like.js b/tests/testdata/subdir/amd_like.js new file mode 100644 index 000000000..f27e505e4 --- /dev/null +++ b/tests/testdata/subdir/amd_like.js @@ -0,0 +1,3 @@ +// looks like an AMD module, but isn't +const define = () => {}; +define(["fake_module"], () => {}); diff --git a/tests/testdata/subdir/auto_print_hello.ts b/tests/testdata/subdir/auto_print_hello.ts new file mode 100644 index 000000000..5efa72e03 --- /dev/null +++ b/tests/testdata/subdir/auto_print_hello.ts @@ -0,0 +1,2 @@ +console.log("hello!"); +export default {}; diff --git a/tests/testdata/subdir/circular1.ts b/tests/testdata/subdir/circular1.ts new file mode 100644 index 000000000..06fdb3373 --- /dev/null +++ b/tests/testdata/subdir/circular1.ts @@ -0,0 +1,7 @@ +import * as circular2 from "./circular2.ts"; + +export function f1() { + console.log("f1"); +} + +circular2.f2(); diff --git a/tests/testdata/subdir/circular2.ts b/tests/testdata/subdir/circular2.ts new file mode 100644 index 000000000..0864b7adf --- /dev/null +++ b/tests/testdata/subdir/circular2.ts @@ -0,0 +1,7 @@ +import * as circular1 from "./circular1.ts"; + +export function f2() { + console.log("f2"); +} + +circular1.f1(); diff --git a/tests/testdata/subdir/comment.ts b/tests/testdata/subdir/comment.ts new file mode 100644 index 000000000..ea7e630c0 --- /dev/null +++ b/tests/testdata/subdir/comment.ts @@ -0,0 +1,4 @@ +// This is a comment. +export function comment(): string { + return "comment"; +} diff --git a/tests/testdata/subdir/config.json b/tests/testdata/subdir/config.json new file mode 100644 index 000000000..01c3b5e79 --- /dev/null +++ b/tests/testdata/subdir/config.json @@ -0,0 +1,6 @@ +{ + "foo": { + "bar": true, + "baz": ["qat", 1] + } +} diff --git a/tests/testdata/subdir/emittable.d.ts b/tests/testdata/subdir/emittable.d.ts new file mode 100644 index 000000000..425b80f24 --- /dev/null +++ b/tests/testdata/subdir/emittable.d.ts @@ -0,0 +1 @@ +export const a: string; diff --git a/tests/testdata/subdir/evil_remote_import.js b/tests/testdata/subdir/evil_remote_import.js new file mode 100644 index 000000000..4ff7d1b97 --- /dev/null +++ b/tests/testdata/subdir/evil_remote_import.js @@ -0,0 +1,4 @@ +// We expect to get a permission denied error if we dynamically +// import this module without --allow-read. +export * from "file:///c:/etc/passwd"; +console.log("Hello from evil_remote_import.js"); diff --git a/tests/testdata/subdir/export_types.ts b/tests/testdata/subdir/export_types.ts new file mode 100644 index 000000000..18c8ed881 --- /dev/null +++ b/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/tests/testdata/subdir/foo_types.d.ts b/tests/testdata/subdir/foo_types.d.ts new file mode 100644 index 000000000..c489584b9 --- /dev/null +++ b/tests/testdata/subdir/foo_types.d.ts @@ -0,0 +1,3 @@ +declare namespace Foo { + const bar: string; +} diff --git a/tests/testdata/subdir/form_urlencoded.txt b/tests/testdata/subdir/form_urlencoded.txt new file mode 100644 index 000000000..70e087c20 --- /dev/null +++ b/tests/testdata/subdir/form_urlencoded.txt @@ -0,0 +1 @@ +field_1=Hi&field_2=%3CDeno%3E
\ No newline at end of file diff --git a/tests/testdata/subdir/import.mts b/tests/testdata/subdir/import.mts new file mode 100644 index 000000000..eeb200f59 --- /dev/null +++ b/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/tests/testdata/subdir/indirect_import_error.js b/tests/testdata/subdir/indirect_import_error.js new file mode 100644 index 000000000..84011d291 --- /dev/null +++ b/tests/testdata/subdir/indirect_import_error.js @@ -0,0 +1 @@ +export * from "does not exist either"; diff --git a/tests/testdata/subdir/indirect_throws.js b/tests/testdata/subdir/indirect_throws.js new file mode 100644 index 000000000..e1810a66c --- /dev/null +++ b/tests/testdata/subdir/indirect_throws.js @@ -0,0 +1 @@ +export * from "./throws.js"; diff --git a/tests/testdata/subdir/json_1.json b/tests/testdata/subdir/json_1.json new file mode 100644 index 000000000..754d16b84 --- /dev/null +++ b/tests/testdata/subdir/json_1.json @@ -0,0 +1,5 @@ +{ + "$var": { "a": 123, "b": [1, 2, 3], "c": null }, + "with space": "invalid variable name", + "function": "reserved word" +} diff --git a/tests/testdata/subdir/json_2.json b/tests/testdata/subdir/json_2.json new file mode 100644 index 000000000..7deb8b173 --- /dev/null +++ b/tests/testdata/subdir/json_2.json @@ -0,0 +1 @@ +"just a string" diff --git a/tests/testdata/subdir/json_3.json b/tests/testdata/subdir/json_3.json new file mode 100644 index 000000000..b20bc0649 --- /dev/null +++ b/tests/testdata/subdir/json_3.json @@ -0,0 +1 @@ +"${globalThis}`and string literal`" diff --git a/tests/testdata/subdir/jsx_import_source_no_pragma.tsx b/tests/testdata/subdir/jsx_import_source_no_pragma.tsx new file mode 100644 index 000000000..2c756054f --- /dev/null +++ b/tests/testdata/subdir/jsx_import_source_no_pragma.tsx @@ -0,0 +1,7 @@ +function A() { + return "hello"; +} + +export function B() { + return <A></A>; +} diff --git a/tests/testdata/subdir/main.ts b/tests/testdata/subdir/main.ts new file mode 100644 index 000000000..29acf42e0 --- /dev/null +++ b/tests/testdata/subdir/main.ts @@ -0,0 +1,3 @@ +if (import.meta.main) { + console.log("Hello, world!"); +} diff --git a/tests/testdata/subdir/mismatch_ext.ts b/tests/testdata/subdir/mismatch_ext.ts new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mismatch_ext.ts @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mod.mjs b/tests/testdata/subdir/mod.mjs new file mode 100644 index 000000000..9233cce2f --- /dev/null +++ b/tests/testdata/subdir/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/tests/testdata/subdir/mod1.ts b/tests/testdata/subdir/mod1.ts new file mode 100644 index 000000000..5e58f432e --- /dev/null +++ b/tests/testdata/subdir/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/testdata/subdir/mod2.ts b/tests/testdata/subdir/mod2.ts new file mode 100644 index 000000000..ce1adc0e8 --- /dev/null +++ b/tests/testdata/subdir/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/testdata/subdir/mod3.js b/tests/testdata/subdir/mod3.js new file mode 100644 index 000000000..ce534f570 --- /dev/null +++ b/tests/testdata/subdir/mod3.js @@ -0,0 +1 @@ +export const isTSFile = false; diff --git a/tests/testdata/subdir/mod4.js b/tests/testdata/subdir/mod4.js new file mode 100644 index 000000000..71332dbc4 --- /dev/null +++ b/tests/testdata/subdir/mod4.js @@ -0,0 +1 @@ +export const isMod4 = true; diff --git a/tests/testdata/subdir/mod5.mjs b/tests/testdata/subdir/mod5.mjs new file mode 100644 index 000000000..f21d8862b --- /dev/null +++ b/tests/testdata/subdir/mod5.mjs @@ -0,0 +1 @@ +export const isMod5 = true; diff --git a/tests/testdata/subdir/mod6.js b/tests/testdata/subdir/mod6.js new file mode 100644 index 000000000..5e17c9ee0 --- /dev/null +++ b/tests/testdata/subdir/mod6.js @@ -0,0 +1 @@ +export { isMod4 } from "./mod4.js"; diff --git a/tests/testdata/subdir/mod7.js b/tests/testdata/subdir/mod7.js new file mode 100644 index 000000000..2bd4b5eb7 --- /dev/null +++ b/tests/testdata/subdir/mod7.js @@ -0,0 +1,3 @@ +import json1 from "./json_1.json" assert { type: "json" }; + +console.log(json1); diff --git a/tests/testdata/subdir/mod8.js b/tests/testdata/subdir/mod8.js new file mode 100644 index 000000000..5bf7a49a8 --- /dev/null +++ b/tests/testdata/subdir/mod8.js @@ -0,0 +1,3 @@ +import json3 from "./json_3.json" assert { type: "json" }; + +console.log(json3); diff --git a/tests/testdata/subdir/more_decorators.ts b/tests/testdata/subdir/more_decorators.ts new file mode 100644 index 000000000..674705d56 --- /dev/null +++ b/tests/testdata/subdir/more_decorators.ts @@ -0,0 +1,18 @@ +// deno-lint-ignore-file +function a() { + console.log("a(): evaluated"); + return ( + _target: any, + _propertyKey: string, + _descriptor: PropertyDescriptor, + ) => { + console.log("a(): called"); + }; +} + +export class B { + @a() + method() { + console.log("method"); + } +} diff --git a/tests/testdata/subdir/mt_application_ecmascript.j2.js b/tests/testdata/subdir/mt_application_ecmascript.j2.js new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_application_ecmascript.j2.js @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_application_ecmascript_jsx.j2.jsx b/tests/testdata/subdir/mt_application_ecmascript_jsx.j2.jsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_application_ecmascript_jsx.j2.jsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_application_x_javascript.j4.js b/tests/testdata/subdir/mt_application_x_javascript.j4.js new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_application_x_javascript.j4.js @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_application_x_javascript_jsx.j4.jsx b/tests/testdata/subdir/mt_application_x_javascript_jsx.j4.jsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_application_x_javascript_jsx.j4.jsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_application_x_typescript.t4.ts b/tests/testdata/subdir/mt_application_x_typescript.t4.ts new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_application_x_typescript.t4.ts @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_application_x_typescript_tsx.t4.tsx b/tests/testdata/subdir/mt_application_x_typescript_tsx.t4.tsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_application_x_typescript_tsx.t4.tsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_javascript.js b/tests/testdata/subdir/mt_javascript.js new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_javascript.js @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_javascript_jsx.jsx b/tests/testdata/subdir/mt_javascript_jsx.jsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_javascript_jsx.jsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_ecmascript.j3.js b/tests/testdata/subdir/mt_text_ecmascript.j3.js new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_text_ecmascript.j3.js @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_ecmascript_jsx.j3.jsx b/tests/testdata/subdir/mt_text_ecmascript_jsx.j3.jsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_text_ecmascript_jsx.j3.jsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_javascript.j1.js b/tests/testdata/subdir/mt_text_javascript.j1.js new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_text_javascript.j1.js @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_javascript_jsx.j1.jsx b/tests/testdata/subdir/mt_text_javascript_jsx.j1.jsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_text_javascript_jsx.j1.jsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_typescript.t1.ts b/tests/testdata/subdir/mt_text_typescript.t1.ts new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_text_typescript.t1.ts @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_text_typescript_tsx.t1.tsx b/tests/testdata/subdir/mt_text_typescript_tsx.t1.tsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_text_typescript_tsx.t1.tsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_video_mp2t.t3.ts b/tests/testdata/subdir/mt_video_mp2t.t3.ts new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_video_mp2t.t3.ts @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_video_mp2t_tsx.t3.tsx b/tests/testdata/subdir/mt_video_mp2t_tsx.t3.tsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_video_mp2t_tsx.t3.tsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/mt_video_vdn.t2.ts b/tests/testdata/subdir/mt_video_vdn.t2.ts new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/mt_video_vdn.t2.ts @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/mt_video_vdn_tsx.t2.tsx b/tests/testdata/subdir/mt_video_vdn_tsx.t2.tsx new file mode 100644 index 000000000..c5c27f9f9 --- /dev/null +++ b/tests/testdata/subdir/mt_video_vdn_tsx.t2.tsx @@ -0,0 +1,5 @@ +const React = { + createElement() {}, +}; +const temp = <div></div>; +export const loaded = true; diff --git a/tests/testdata/subdir/no_ext b/tests/testdata/subdir/no_ext new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/no_ext @@ -0,0 +1 @@ +export const loaded = true; diff --git a/tests/testdata/subdir/no_js_ext b/tests/testdata/subdir/no_js_ext new file mode 100644 index 000000000..8322a106f --- /dev/null +++ b/tests/testdata/subdir/no_js_ext @@ -0,0 +1,3 @@ +// @ts-check +import { printHello } from "./mod2.ts"; +printHello(); diff --git a/tests/testdata/subdir/polyfill.ts b/tests/testdata/subdir/polyfill.ts new file mode 100644 index 000000000..7af67c4c0 --- /dev/null +++ b/tests/testdata/subdir/polyfill.ts @@ -0,0 +1,8 @@ +declare global { + const polyfill: () => void; +} + +// deno-lint-ignore no-explicit-any +(globalThis as any).polyfill = () => { + console.log("polyfill"); +}; diff --git a/tests/testdata/subdir/print_hello.ts b/tests/testdata/subdir/print_hello.ts new file mode 100644 index 000000000..b9c0ad527 --- /dev/null +++ b/tests/testdata/subdir/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/testdata/subdir/redirects/a.ts b/tests/testdata/subdir/redirects/a.ts new file mode 100644 index 000000000..071ee4728 --- /dev/null +++ b/tests/testdata/subdir/redirects/a.ts @@ -0,0 +1,9 @@ +import { createA } from "./b.ts"; + +export class A { + private _a = "a"; +} + +export function start(): A { + return createA(); +} diff --git a/tests/testdata/subdir/redirects/b.ts b/tests/testdata/subdir/redirects/b.ts new file mode 100644 index 000000000..cdb71eaae --- /dev/null +++ b/tests/testdata/subdir/redirects/b.ts @@ -0,0 +1,5 @@ +import { A } from "./a.ts"; + +export function createA(): A { + return new A(); +} diff --git a/tests/testdata/subdir/redirects/redirect1.js b/tests/testdata/subdir/redirects/redirect1.js new file mode 100644 index 000000000..d674be88c --- /dev/null +++ b/tests/testdata/subdir/redirects/redirect1.js @@ -0,0 +1 @@ +export const redirect = 1; diff --git a/tests/testdata/subdir/redirects/redirect1.ts b/tests/testdata/subdir/redirects/redirect1.ts new file mode 100644 index 000000000..d674be88c --- /dev/null +++ b/tests/testdata/subdir/redirects/redirect1.ts @@ -0,0 +1 @@ +export const redirect = 1; diff --git a/tests/testdata/subdir/redirects/redirect2.js b/tests/testdata/subdir/redirects/redirect2.js new file mode 100644 index 000000000..e4244f638 --- /dev/null +++ b/tests/testdata/subdir/redirects/redirect2.js @@ -0,0 +1 @@ +import "./redirect1.js"; diff --git a/tests/testdata/subdir/redirects/redirect3.js b/tests/testdata/subdir/redirects/redirect3.js new file mode 100644 index 000000000..e24f2af32 --- /dev/null +++ b/tests/testdata/subdir/redirects/redirect3.js @@ -0,0 +1,2 @@ +import { redirect } from "./redirect1.js"; +export const value = `3 imports ${redirect}`; diff --git a/tests/testdata/subdir/redirects/redirect4.ts b/tests/testdata/subdir/redirects/redirect4.ts new file mode 100644 index 000000000..45c65c5eb --- /dev/null +++ b/tests/testdata/subdir/redirects/redirect4.ts @@ -0,0 +1,2 @@ +import { redirect } from "./redirect1.ts"; +export const value = `4 imports ${redirect}`; diff --git a/tests/testdata/subdir/shebang_file.js b/tests/testdata/subdir/shebang_file.js new file mode 100644 index 000000000..1c81be31c --- /dev/null +++ b/tests/testdata/subdir/shebang_file.js @@ -0,0 +1,5 @@ +#!/usr/bin/env -S deno run --allow-read + +for (const item of Deno.readDirSync(".")) { + console.log(item.name); +} diff --git a/tests/testdata/subdir/single_module.ts b/tests/testdata/subdir/single_module.ts new file mode 100644 index 000000000..940a3ff0e --- /dev/null +++ b/tests/testdata/subdir/single_module.ts @@ -0,0 +1 @@ +console.log("Hello world!"); diff --git a/tests/testdata/subdir/subdir2/dynamic_import.ts b/tests/testdata/subdir/subdir2/dynamic_import.ts new file mode 100644 index 000000000..59beb64c3 --- /dev/null +++ b/tests/testdata/subdir/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/testdata/subdir/subdir2/mod2.ts b/tests/testdata/subdir/subdir2/mod2.ts new file mode 100644 index 000000000..9071d0aeb --- /dev/null +++ b/tests/testdata/subdir/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/testdata/subdir/test_worker_basic.js b/tests/testdata/subdir/test_worker_basic.js new file mode 100644 index 000000000..b960128b4 --- /dev/null +++ b/tests/testdata/subdir/test_worker_basic.js @@ -0,0 +1,14 @@ +console.log("hello from test_worker_basic.js"); + +if (self.name !== "jsWorker") { + throw Error(`Bad worker name: ${self.name}, expected jsWorker`); +} + +onmessage = function (e) { + postMessage(e.data); + close(); +}; + +onerror = function () { + return false; +}; diff --git a/tests/testdata/subdir/throws.js b/tests/testdata/subdir/throws.js new file mode 100644 index 000000000..abdf29156 --- /dev/null +++ b/tests/testdata/subdir/throws.js @@ -0,0 +1,6 @@ +// deno-lint-ignore-file +export function boo() { + console.log("Boo!"); +} + +throw new Error("An error"); diff --git a/tests/testdata/subdir/tla.ts b/tests/testdata/subdir/tla.ts new file mode 100644 index 000000000..713dbfca0 --- /dev/null +++ b/tests/testdata/subdir/tla.ts @@ -0,0 +1 @@ +export const foo = await Promise.resolve("Hello"); diff --git a/tests/testdata/subdir/type_and_code.ts b/tests/testdata/subdir/type_and_code.ts new file mode 100644 index 000000000..b14713419 --- /dev/null +++ b/tests/testdata/subdir/type_and_code.ts @@ -0,0 +1,7 @@ +export interface AnInterface { + a: string; +} + +export function isAnInterface(value: unknown): value is AnInterface { + return value && typeof value === "object" && "a" in value; +} diff --git a/tests/testdata/subdir/type_error.ts b/tests/testdata/subdir/type_error.ts new file mode 100644 index 000000000..cc3c1d29d --- /dev/null +++ b/tests/testdata/subdir/type_error.ts @@ -0,0 +1 @@ +export const a: "a" = 12; diff --git a/tests/testdata/subdir/type_reference.d.ts b/tests/testdata/subdir/type_reference.d.ts new file mode 100644 index 000000000..f9b8de5ed --- /dev/null +++ b/tests/testdata/subdir/type_reference.d.ts @@ -0,0 +1 @@ +export const foo: "foo"; diff --git a/tests/testdata/subdir/type_reference.js b/tests/testdata/subdir/type_reference.js new file mode 100644 index 000000000..917d89198 --- /dev/null +++ b/tests/testdata/subdir/type_reference.js @@ -0,0 +1,3 @@ +/// <reference types="./type_reference.d.ts" /> + +export const foo = "foo"; diff --git a/tests/testdata/subdir/types.d.mts b/tests/testdata/subdir/types.d.mts new file mode 100644 index 000000000..28c282146 --- /dev/null +++ b/tests/testdata/subdir/types.d.mts @@ -0,0 +1 @@ +export type A = "a"; diff --git a/tests/testdata/subdir/unknown_ext.deno b/tests/testdata/subdir/unknown_ext.deno new file mode 100644 index 000000000..e67d2a017 --- /dev/null +++ b/tests/testdata/subdir/unknown_ext.deno @@ -0,0 +1 @@ +export const loaded = true; |