From f5e46c9bf2f50d66a953fa133161fc829cecff06 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sat, 10 Feb 2024 13:22:13 -0700 Subject: chore: move cli/tests/ -> tests/ (#22369) This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit. --- cli/tests/testdata/inspector/bar.js | 3 --- cli/tests/testdata/inspector/error_with_npm_import.js | 7 ------- cli/tests/testdata/inspector/foo.ts | 10 ---------- cli/tests/testdata/inspector/inspect_wait.js | 2 -- cli/tests/testdata/inspector/inspector1.js | 3 --- cli/tests/testdata/inspector/inspector2.js | 4 ---- cli/tests/testdata/inspector/inspector3.js | 13 ------------- cli/tests/testdata/inspector/inspector4.js | 5 ----- cli/tests/testdata/inspector/inspector_test.js | 3 --- cli/tests/testdata/inspector/memory.js | 13 ------------- cli/tests/testdata/inspector/test.ts | 5 ----- 11 files changed, 68 deletions(-) delete mode 100644 cli/tests/testdata/inspector/bar.js delete mode 100644 cli/tests/testdata/inspector/error_with_npm_import.js delete mode 100644 cli/tests/testdata/inspector/foo.ts delete mode 100644 cli/tests/testdata/inspector/inspect_wait.js delete mode 100644 cli/tests/testdata/inspector/inspector1.js delete mode 100644 cli/tests/testdata/inspector/inspector2.js delete mode 100644 cli/tests/testdata/inspector/inspector3.js delete mode 100644 cli/tests/testdata/inspector/inspector4.js delete mode 100644 cli/tests/testdata/inspector/inspector_test.js delete mode 100644 cli/tests/testdata/inspector/memory.js delete mode 100644 cli/tests/testdata/inspector/test.ts (limited to 'cli/tests/testdata/inspector') diff --git a/cli/tests/testdata/inspector/bar.js b/cli/tests/testdata/inspector/bar.js deleted file mode 100644 index 278fc9030..000000000 --- a/cli/tests/testdata/inspector/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -export function bar() { - return "world"; -} diff --git a/cli/tests/testdata/inspector/error_with_npm_import.js b/cli/tests/testdata/inspector/error_with_npm_import.js deleted file mode 100644 index 9244f2cf2..000000000 --- a/cli/tests/testdata/inspector/error_with_npm_import.js +++ /dev/null @@ -1,7 +0,0 @@ -// deno-lint-ignore-file - -import chalk from "npm:chalk"; - -console.log("hello"); - -throw new Error("boom!"); diff --git a/cli/tests/testdata/inspector/foo.ts b/cli/tests/testdata/inspector/foo.ts deleted file mode 100644 index c0735926f..000000000 --- a/cli/tests/testdata/inspector/foo.ts +++ /dev/null @@ -1,10 +0,0 @@ -class Foo { - hello(): string { - return "hello"; - } -} - -export function foo(): string { - const f = new Foo(); - return f.hello(); -} diff --git a/cli/tests/testdata/inspector/inspect_wait.js b/cli/tests/testdata/inspector/inspect_wait.js deleted file mode 100644 index e2b10199c..000000000 --- a/cli/tests/testdata/inspector/inspect_wait.js +++ /dev/null @@ -1,2 +0,0 @@ -Deno.writeTextFileSync("./hello.txt", "hello world"); -console.error("did run"); diff --git a/cli/tests/testdata/inspector/inspector1.js b/cli/tests/testdata/inspector/inspector1.js deleted file mode 100644 index 5cb059def..000000000 --- a/cli/tests/testdata/inspector/inspector1.js +++ /dev/null @@ -1,3 +0,0 @@ -setInterval(() => { - console.log("hello"); -}, 1000); diff --git a/cli/tests/testdata/inspector/inspector2.js b/cli/tests/testdata/inspector/inspector2.js deleted file mode 100644 index 57f80ef94..000000000 --- a/cli/tests/testdata/inspector/inspector2.js +++ /dev/null @@ -1,4 +0,0 @@ -console.log("hello from the script"); - -// This process will be killed before the timeout is over. -await new Promise((res, _) => setTimeout(res, 1000)); diff --git a/cli/tests/testdata/inspector/inspector3.js b/cli/tests/testdata/inspector/inspector3.js deleted file mode 100644 index 8d605a286..000000000 --- a/cli/tests/testdata/inspector/inspector3.js +++ /dev/null @@ -1,13 +0,0 @@ -// deno-lint-ignore-file - -// check that console methods provided by V8 are available in the inspector -console.timeStamp("foo"); -console.profile("foo"); -console.profileEnd("foo"); - -for (let i = 0; i < 128; i++) { - console.log(i); - debugger; -} -await new Promise((res, _) => setTimeout(res, 100)); -console.log("done"); diff --git a/cli/tests/testdata/inspector/inspector4.js b/cli/tests/testdata/inspector/inspector4.js deleted file mode 100644 index 1bf419650..000000000 --- a/cli/tests/testdata/inspector/inspector4.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log("hello"); - -setInterval(() => { - console.log("hello from interval"); -}, 1000); diff --git a/cli/tests/testdata/inspector/inspector_test.js b/cli/tests/testdata/inspector/inspector_test.js deleted file mode 100644 index 86cd48854..000000000 --- a/cli/tests/testdata/inspector/inspector_test.js +++ /dev/null @@ -1,3 +0,0 @@ -Deno.test("basic test", () => { - console.log("test has finished running"); -}); diff --git a/cli/tests/testdata/inspector/memory.js b/cli/tests/testdata/inspector/memory.js deleted file mode 100644 index 082d6367c..000000000 --- a/cli/tests/testdata/inspector/memory.js +++ /dev/null @@ -1,13 +0,0 @@ -const objs = []; - -class Foo { - foo() { - return "foo"; - } -} - -setInterval(() => { - objs.push(new Foo()); -}, 1000); - -console.log("hello!"); diff --git a/cli/tests/testdata/inspector/test.ts b/cli/tests/testdata/inspector/test.ts deleted file mode 100644 index 2b33f22e5..000000000 --- a/cli/tests/testdata/inspector/test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { foo } from "./foo.ts"; -import { bar } from "./bar.js"; - -console.log(foo()); -console.log(bar()); -- cgit v1.2.3