diff options
| author | Matt Mastracci <matthew@mastracci.com> | 2024-02-10 13:22:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-10 20:22:13 +0000 |
| commit | f5e46c9bf2f50d66a953fa133161fc829cecff06 (patch) | |
| tree | 8faf2f5831c1c7b11d842cd9908d141082c869a5 /tests/testdata/inspector | |
| parent | d2477f780630a812bfd65e3987b70c0d309385bb (diff) | |
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.
Diffstat (limited to 'tests/testdata/inspector')
| -rw-r--r-- | tests/testdata/inspector/bar.js | 3 | ||||
| -rw-r--r-- | tests/testdata/inspector/error_with_npm_import.js | 7 | ||||
| -rw-r--r-- | tests/testdata/inspector/foo.ts | 10 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspect_wait.js | 2 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspector1.js | 3 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspector2.js | 4 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspector3.js | 13 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspector4.js | 5 | ||||
| -rw-r--r-- | tests/testdata/inspector/inspector_test.js | 3 | ||||
| -rw-r--r-- | tests/testdata/inspector/memory.js | 13 | ||||
| -rw-r--r-- | tests/testdata/inspector/test.ts | 5 |
11 files changed, 68 insertions, 0 deletions
diff --git a/tests/testdata/inspector/bar.js b/tests/testdata/inspector/bar.js new file mode 100644 index 000000000..278fc9030 --- /dev/null +++ b/tests/testdata/inspector/bar.js @@ -0,0 +1,3 @@ +export function bar() { + return "world"; +} diff --git a/tests/testdata/inspector/error_with_npm_import.js b/tests/testdata/inspector/error_with_npm_import.js new file mode 100644 index 000000000..9244f2cf2 --- /dev/null +++ b/tests/testdata/inspector/error_with_npm_import.js @@ -0,0 +1,7 @@ +// deno-lint-ignore-file + +import chalk from "npm:chalk"; + +console.log("hello"); + +throw new Error("boom!"); diff --git a/tests/testdata/inspector/foo.ts b/tests/testdata/inspector/foo.ts new file mode 100644 index 000000000..c0735926f --- /dev/null +++ b/tests/testdata/inspector/foo.ts @@ -0,0 +1,10 @@ +class Foo { + hello(): string { + return "hello"; + } +} + +export function foo(): string { + const f = new Foo(); + return f.hello(); +} diff --git a/tests/testdata/inspector/inspect_wait.js b/tests/testdata/inspector/inspect_wait.js new file mode 100644 index 000000000..e2b10199c --- /dev/null +++ b/tests/testdata/inspector/inspect_wait.js @@ -0,0 +1,2 @@ +Deno.writeTextFileSync("./hello.txt", "hello world"); +console.error("did run"); diff --git a/tests/testdata/inspector/inspector1.js b/tests/testdata/inspector/inspector1.js new file mode 100644 index 000000000..5cb059def --- /dev/null +++ b/tests/testdata/inspector/inspector1.js @@ -0,0 +1,3 @@ +setInterval(() => { + console.log("hello"); +}, 1000); diff --git a/tests/testdata/inspector/inspector2.js b/tests/testdata/inspector/inspector2.js new file mode 100644 index 000000000..57f80ef94 --- /dev/null +++ b/tests/testdata/inspector/inspector2.js @@ -0,0 +1,4 @@ +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/tests/testdata/inspector/inspector3.js b/tests/testdata/inspector/inspector3.js new file mode 100644 index 000000000..8d605a286 --- /dev/null +++ b/tests/testdata/inspector/inspector3.js @@ -0,0 +1,13 @@ +// 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/tests/testdata/inspector/inspector4.js b/tests/testdata/inspector/inspector4.js new file mode 100644 index 000000000..1bf419650 --- /dev/null +++ b/tests/testdata/inspector/inspector4.js @@ -0,0 +1,5 @@ +console.log("hello"); + +setInterval(() => { + console.log("hello from interval"); +}, 1000); diff --git a/tests/testdata/inspector/inspector_test.js b/tests/testdata/inspector/inspector_test.js new file mode 100644 index 000000000..86cd48854 --- /dev/null +++ b/tests/testdata/inspector/inspector_test.js @@ -0,0 +1,3 @@ +Deno.test("basic test", () => { + console.log("test has finished running"); +}); diff --git a/tests/testdata/inspector/memory.js b/tests/testdata/inspector/memory.js new file mode 100644 index 000000000..082d6367c --- /dev/null +++ b/tests/testdata/inspector/memory.js @@ -0,0 +1,13 @@ +const objs = []; + +class Foo { + foo() { + return "foo"; + } +} + +setInterval(() => { + objs.push(new Foo()); +}, 1000); + +console.log("hello!"); diff --git a/tests/testdata/inspector/test.ts b/tests/testdata/inspector/test.ts new file mode 100644 index 000000000..2b33f22e5 --- /dev/null +++ b/tests/testdata/inspector/test.ts @@ -0,0 +1,5 @@ +import { foo } from "./foo.ts"; +import { bar } from "./bar.js"; + +console.log(foo()); +console.log(bar()); |
