summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node/testdata')
-rw-r--r--cli/tests/unit_node/testdata/add_global_property.js1
-rw-r--r--cli/tests/unit_node/testdata/add_global_property_run_main.js1
-rw-r--r--cli/tests/unit_node/testdata/binary_stdio.js11
-rw-r--r--cli/tests/unit_node/testdata/child_process_stdio.js16
-rw-r--r--cli/tests/unit_node/testdata/child_process_stdio_012.js16
-rw-r--r--cli/tests/unit_node/testdata/child_process_unref.js10
-rw-r--r--cli/tests/unit_node/testdata/exec_file_text_error.js2
-rw-r--r--cli/tests/unit_node/testdata/exec_file_text_output.js1
-rw-r--r--cli/tests/unit_node/testdata/infinite_loop.js3
-rw-r--r--cli/tests/unit_node/testdata/lorem_ipsum.txt1
-rw-r--r--cli/tests/unit_node/testdata/node_modules/foo/index.js4
-rw-r--r--cli/tests/unit_node/testdata/node_modules/foo/package.json3
-rw-r--r--cli/tests/unit_node/testdata/process_exit.ts19
-rw-r--r--cli/tests/unit_node/testdata/process_exit2.ts4
-rw-r--r--cli/tests/unit_node/testdata/process_really_exit.ts10
-rw-r--r--cli/tests/unit_node/testdata/process_stdin.ts11
-rw-r--r--cli/tests/unit_node/testdata/process_stdin_dummy.txt2
-rw-r--r--cli/tests/unit_node/testdata/rsa_private.pem28
-rw-r--r--cli/tests/unit_node/testdata/rsa_private_pkcs1.pem27
-rw-r--r--cli/tests/unit_node/testdata/rsa_public.pem9
-rw-r--r--cli/tests/unit_node/testdata/worker_module/index.js3
-rw-r--r--cli/tests/unit_node/testdata/worker_module/other_file.js3
-rw-r--r--cli/tests/unit_node/testdata/worker_module/package.json4
-rw-r--r--cli/tests/unit_node/testdata/worker_threads.mjs34
24 files changed, 0 insertions, 223 deletions
diff --git a/cli/tests/unit_node/testdata/add_global_property.js b/cli/tests/unit_node/testdata/add_global_property.js
deleted file mode 100644
index 814d17d0d..000000000
--- a/cli/tests/unit_node/testdata/add_global_property.js
+++ /dev/null
@@ -1 +0,0 @@
-globalThis.foo = "Hello";
diff --git a/cli/tests/unit_node/testdata/add_global_property_run_main.js b/cli/tests/unit_node/testdata/add_global_property_run_main.js
deleted file mode 100644
index c9db1cea6..000000000
--- a/cli/tests/unit_node/testdata/add_global_property_run_main.js
+++ /dev/null
@@ -1 +0,0 @@
-globalThis.calledViaRunMain = true;
diff --git a/cli/tests/unit_node/testdata/binary_stdio.js b/cli/tests/unit_node/testdata/binary_stdio.js
deleted file mode 100644
index aa370a933..000000000
--- a/cli/tests/unit_node/testdata/binary_stdio.js
+++ /dev/null
@@ -1,11 +0,0 @@
-const buffer = new Uint8Array(10);
-const nread = await Deno.stdin.read(buffer);
-
-if (nread != 10) {
- throw new Error("Too little data read");
-}
-
-const nwritten = await Deno.stdout.write(buffer);
-if (nwritten != 10) {
- throw new Error("Too little data written");
-}
diff --git a/cli/tests/unit_node/testdata/child_process_stdio.js b/cli/tests/unit_node/testdata/child_process_stdio.js
deleted file mode 100644
index b13b09562..000000000
--- a/cli/tests/unit_node/testdata/child_process_stdio.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import childProcess from "node:child_process";
-import process from "node:process";
-import * as path from "node:path";
-import { fileURLToPath } from "node:url";
-
-const script = path.join(
- path.dirname(fileURLToPath(import.meta.url)),
- "node_modules",
- "foo",
- "index.js",
-);
-
-const child = childProcess.spawn(process.execPath, [script], {
- stdio: [process.stdin, process.stdout, process.stderr],
-});
-child.on("close", () => console.log("close"));
diff --git a/cli/tests/unit_node/testdata/child_process_stdio_012.js b/cli/tests/unit_node/testdata/child_process_stdio_012.js
deleted file mode 100644
index e3717f985..000000000
--- a/cli/tests/unit_node/testdata/child_process_stdio_012.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import childProcess from "node:child_process";
-import process from "node:process";
-import * as path from "node:path";
-import { fileURLToPath } from "node:url";
-
-const script = path.join(
- path.dirname(fileURLToPath(import.meta.url)),
- "node_modules",
- "foo",
- "index.js",
-);
-
-const child = childProcess.spawn(process.execPath, [script], {
- stdio: [0, 1, 2],
-});
-child.on("close", () => console.log("close"));
diff --git a/cli/tests/unit_node/testdata/child_process_unref.js b/cli/tests/unit_node/testdata/child_process_unref.js
deleted file mode 100644
index 8201ac44d..000000000
--- a/cli/tests/unit_node/testdata/child_process_unref.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import cp from "node:child_process";
-import * as path from "node:path";
-import { fileURLToPath } from "node:url";
-
-const script = path.join(
- path.dirname(fileURLToPath(import.meta.url)),
- "infinite_loop.js",
-);
-const childProcess = cp.spawn(Deno.execPath(), ["run", script]);
-childProcess.unref();
diff --git a/cli/tests/unit_node/testdata/exec_file_text_error.js b/cli/tests/unit_node/testdata/exec_file_text_error.js
deleted file mode 100644
index 9697e6044..000000000
--- a/cli/tests/unit_node/testdata/exec_file_text_error.js
+++ /dev/null
@@ -1,2 +0,0 @@
-console.error("yikes!");
-Deno.exit(1);
diff --git a/cli/tests/unit_node/testdata/exec_file_text_output.js b/cli/tests/unit_node/testdata/exec_file_text_output.js
deleted file mode 100644
index 019c0f4bc..000000000
--- a/cli/tests/unit_node/testdata/exec_file_text_output.js
+++ /dev/null
@@ -1 +0,0 @@
-console.log("Hello World!");
diff --git a/cli/tests/unit_node/testdata/infinite_loop.js b/cli/tests/unit_node/testdata/infinite_loop.js
deleted file mode 100644
index 0e6540a7b..000000000
--- a/cli/tests/unit_node/testdata/infinite_loop.js
+++ /dev/null
@@ -1,3 +0,0 @@
-while (true) {
- await new Promise((resolve) => setTimeout(resolve, 1000));
-}
diff --git a/cli/tests/unit_node/testdata/lorem_ipsum.txt b/cli/tests/unit_node/testdata/lorem_ipsum.txt
deleted file mode 100644
index 08e00ed29..000000000
--- a/cli/tests/unit_node/testdata/lorem_ipsum.txt
+++ /dev/null
@@ -1 +0,0 @@
-Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file
diff --git a/cli/tests/unit_node/testdata/node_modules/foo/index.js b/cli/tests/unit_node/testdata/node_modules/foo/index.js
deleted file mode 100644
index 24faba789..000000000
--- a/cli/tests/unit_node/testdata/node_modules/foo/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-console.log("foo");
-console.log(typeof require === "function");
-console.log(typeof module === "object");
-console.log(typeof exports === "object");
diff --git a/cli/tests/unit_node/testdata/node_modules/foo/package.json b/cli/tests/unit_node/testdata/node_modules/foo/package.json
deleted file mode 100644
index bde99de92..000000000
--- a/cli/tests/unit_node/testdata/node_modules/foo/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name": "foo"
-}
diff --git a/cli/tests/unit_node/testdata/process_exit.ts b/cli/tests/unit_node/testdata/process_exit.ts
deleted file mode 100644
index 57351c087..000000000
--- a/cli/tests/unit_node/testdata/process_exit.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import process from "node:process";
-
-//deno-lint-ignore no-undef
-process.on("exit", () => {
- console.log(1);
-});
-
-function unexpected() {
- console.log(null);
-}
-//deno-lint-ignore no-undef
-process.on("exit", unexpected);
-//deno-lint-ignore no-undef
-process.removeListener("exit", unexpected);
-
-//deno-lint-ignore no-undef
-process.on("exit", () => {
- console.log(2);
-});
diff --git a/cli/tests/unit_node/testdata/process_exit2.ts b/cli/tests/unit_node/testdata/process_exit2.ts
deleted file mode 100644
index 3731f745a..000000000
--- a/cli/tests/unit_node/testdata/process_exit2.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import process from "node:process";
-
-process.on("exit", () => console.log("exit"));
-process.exit();
diff --git a/cli/tests/unit_node/testdata/process_really_exit.ts b/cli/tests/unit_node/testdata/process_really_exit.ts
deleted file mode 100644
index 16f30b33d..000000000
--- a/cli/tests/unit_node/testdata/process_really_exit.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import process from "node:process";
-
-//deno-lint-ignore no-undef
-// @ts-ignore - Node typings don't even have this because it's
-// been deprecated for 4 years. But it's used in `signal-exit`,
-// which in turn is used in `node-tap`.
-process.reallyExit = function () {
- console.info("really exited");
-};
-process.exit();
diff --git a/cli/tests/unit_node/testdata/process_stdin.ts b/cli/tests/unit_node/testdata/process_stdin.ts
deleted file mode 100644
index 23562b090..000000000
--- a/cli/tests/unit_node/testdata/process_stdin.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import process from "node:process";
-
-console.log(process.stdin.readableHighWaterMark);
-
-process.stdin.setEncoding("utf8");
-process.stdin.on("readable", () => {
- console.log(process.stdin.read());
-});
-process.stdin.on("end", () => {
- console.log("end");
-});
diff --git a/cli/tests/unit_node/testdata/process_stdin_dummy.txt b/cli/tests/unit_node/testdata/process_stdin_dummy.txt
deleted file mode 100644
index a907ec3f4..000000000
--- a/cli/tests/unit_node/testdata/process_stdin_dummy.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-foo
-bar \ No newline at end of file
diff --git a/cli/tests/unit_node/testdata/rsa_private.pem b/cli/tests/unit_node/testdata/rsa_private.pem
deleted file mode 100644
index cd274ae6d..000000000
--- a/cli/tests/unit_node/testdata/rsa_private.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC33FiIiiexwLe/
-P8DZx5HsqFlmUO7/lvJ7necJVNwqdZ3ax5jpQB0p6uxfqeOvzcN3k5V7UFb/Am+n
-kSNZMAZhsWzCU2Z4Pjh50QYz3f0Hour7/yIGStOLyYY3hgLK2K8TbhgjQPhdkw9+
-QtKlpvbL8fLgONAoGrVOFnRQGcr70iFffsm79mgZhKVMgYiHPJqJgGHvCtkGg9zM
-gS7p63+Q3ZWedtFS2RhMX3uCBy/mH6EOlRCNBbRmA4xxNzyf5GQ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+uU
-M/9iXGZ+TDkFsZk4/VUsaNmfYOQf1oyLA2ZsNcU90bQbeHNCi/H/19qOJFXgNaCE
-sd5P3DMl9lptFGIjRVBHjvbfTQBUR5fi+BusMGfrTQKBgQCTtzMEJP2sef883AJr
-XuGVPLzwLi9eTBvPzc5r5pfkvh7mDDmWFxHZm5kctvavqgy32uUPsQgMi1Kz67bU
-s5dY9MCVrN2elhTLD8LOiAz8836o3AxFefm5cUWGaU/aZWDYR0QtNqFdyHyRaodo
-JJfnfK+oK1Eq7+PvpXfVN9BkYw==
------END PRIVATE KEY-----
diff --git a/cli/tests/unit_node/testdata/rsa_private_pkcs1.pem b/cli/tests/unit_node/testdata/rsa_private_pkcs1.pem
deleted file mode 100644
index 215e5cc51..000000000
--- a/cli/tests/unit_node/testdata/rsa_private_pkcs1.pem
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpQIBAAKCAQEAt9xYiIonscC3vz/A2ceR7KhZZlDu/5bye53nCVTcKnWd2seY
-6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAGYbFswlNmeD44edEGM939B6Lq+/8i
-BkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2y/Hy4DjQKBq1ThZ0UBnK+9IhX37J
-u/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/kN2VnnbRUtkYTF97ggcv5h+hDpUQ
-jQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsFdi6hHcpZgbopPL630296iByyigQC
-PJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx9QIDAQABAoIBAQCS2erYu8gyoGPi
-3E/zYgQ6ishFAZWzDWSFubwD5wSm4SSAzvViL/RbO6kqS25xR569DmLRiHzD17VI
-mJMsNECUnPrqR2TL256OJZaXrNHh3I1lUwVhEzjeKMsL4/ys+d70XPXoiocVblVs
-moDXEIGEqa48ywPvVE3Fngeuxrsq3/GCVBNiwtt0YjAOZxmKEh31UZdHO+YI+wNF
-/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it_node/testdata/rsa_public.pem b/cli/tests/unit_node/testdata/rsa_public.pem
deleted file mode 100644
index 8c30cfa52..000000000
--- a/cli/tests/unit_node/testdata/rsa_public.pem
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt9xYiIonscC3vz/A2ceR
-7KhZZlDu/5bye53nCVTcKnWd2seY6UAdKersX6njr83Dd5OVe1BW/wJvp5EjWTAG
-YbFswlNmeD44edEGM939B6Lq+/8iBkrTi8mGN4YCytivE24YI0D4XZMPfkLSpab2
-y/Hy4DjQKBq1ThZ0UBnK+9IhX37Ju/ZoGYSlTIGIhzyaiYBh7wrZBoPczIEu6et/
-kN2VnnbRUtkYTF97ggcv5h+hDpUQjQW0ZgOMcTc8n+RkGpIt0/iM/bTjI3Tz/gsF
-di6hHcpZgbopPL630296iByyigQCPJVzdusFrQN5DeC+zT/nGypQkZanLb4ZspSx
-9QIDAQAB
------END PUBLIC KEY-----
diff --git a/cli/tests/unit_node/testdata/worker_module/index.js b/cli/tests/unit_node/testdata/worker_module/index.js
deleted file mode 100644
index a3e976b65..000000000
--- a/cli/tests/unit_node/testdata/worker_module/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import { myFunction } from "./other_file.js";
-
-myFunction().then(() => {});
diff --git a/cli/tests/unit_node/testdata/worker_module/other_file.js b/cli/tests/unit_node/testdata/worker_module/other_file.js
deleted file mode 100644
index 41789dfe8..000000000
--- a/cli/tests/unit_node/testdata/worker_module/other_file.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export async function myFunction() {
- await new Promise((resolve) => setTimeout(resolve, 100));
-}
diff --git a/cli/tests/unit_node/testdata/worker_module/package.json b/cli/tests/unit_node/testdata/worker_module/package.json
deleted file mode 100644
index 486d2f82b..000000000
--- a/cli/tests/unit_node/testdata/worker_module/package.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "foo",
- "type": "module"
-}
diff --git a/cli/tests/unit_node/testdata/worker_threads.mjs b/cli/tests/unit_node/testdata/worker_threads.mjs
deleted file mode 100644
index 03dc462f0..000000000
--- a/cli/tests/unit_node/testdata/worker_threads.mjs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import {
- getEnvironmentData,
- isMainThread,
- parentPort,
- threadId,
- workerData,
-} from "node:worker_threads";
-import { once } from "node:events";
-
-async function message(expectedMessage) {
- const [message] = await once(parentPort, "message");
- if (message !== expectedMessage) {
- console.log(`Expected the message "${expectedMessage}", but got`, message);
- // fail test
- parentPort.close();
- }
-}
-
-await message("Hello, how are you my thread?");
-
-parentPort.postMessage("I'm fine!");
-
-await new Promise((resolve) => setTimeout(resolve, 100));
-
-parentPort.postMessage({
- isMainThread,
- threadId,
- workerData: Array.isArray(workerData) &&
- workerData[workerData.length - 1] instanceof MessagePort
- ? workerData.slice(0, -1)
- : workerData,
- envData: [getEnvironmentData("test"), getEnvironmentData(1)],
-});