1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

chore: deprecate node compat itests (#25573)

This commit is contained in:
Mohammad Sulaiman 2024-09-16 11:53:20 +03:00 committed by GitHub
parent e4ea9be874
commit eb8ee95f08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 56 additions and 63 deletions

View file

@ -41,8 +41,6 @@ mod jupyter;
mod lint; mod lint;
#[path = "lsp_tests.rs"] #[path = "lsp_tests.rs"]
mod lsp; mod lsp;
#[path = "node_compat_tests.rs"]
mod node_compat_tests;
#[path = "node_unit_tests.rs"] #[path = "node_unit_tests.rs"]
mod node_unit_tests; mod node_unit_tests;
#[path = "npm_tests.rs"] #[path = "npm_tests.rs"]

View file

@ -1,37 +0,0 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
use test_util as util;
use test_util::itest;
use util::env_vars_for_npm_tests;
itest!(node_test_module {
args: "test node/test.js",
output: "node/test.out",
envs: env_vars_for_npm_tests(),
exit_code: 1,
http_server: true,
});
itest!(node_test_module_no_sanitizers {
args: "test -A --no-check node/test_no_sanitizers/test.js",
output: "node/test_no_sanitizers/test.out",
envs: env_vars_for_npm_tests(),
exit_code: 0,
// TODO(mmastrac): fix exit sanitizer part of test
// exit_code: 123,
http_server: true,
});
itest!(
node_process_beforeexit_exit_events_emitted_without_listeners {
args: "run node/process_beforeexit_exit_events.ts",
output: "node/process_beforeexit_exit_events.out",
exit_code: 0,
}
);
itest!(web_node_events_dispatched_in_correct_order {
args: "run node/events_order.ts",
output: "node/events_order.out",
exit_code: 0,
});

View file

@ -0,0 +1,5 @@
{
"args": "run process_beforeexit_exit_events.ts",
"output": "process_beforeexit_exit_events.out",
"exitCode": 0
}

View file

@ -0,0 +1,9 @@
{
"args": "test test.js",
"output": "test.out",
"envs": {
"NO_COLOR": "1",
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
},
"exitCode": 1
}

View file

@ -1,5 +1,5 @@
[WILDCARD] [WILDCARD]
running 63 tests from ./node/test.js running 63 tests from ./test.js
sync pass todo ... sync pass todo ...
------- output ------- ------- output -------
Warning: Not implemented: test.TestContext.todo Warning: Not implemented: test.TestContext.todo
@ -57,7 +57,7 @@ async assertion fail ... FAILED [WILDCARD]
resolve pass ... ok [WILDCARD] resolve pass ... ok [WILDCARD]
reject fail ... FAILED [WILDCARD] reject fail ... FAILED [WILDCARD]
unhandled rejection - passes but warns ... unhandled rejection - passes but warns ...
Uncaught error from ./node/test.js FAILED Uncaught error from ./test.js FAILED
unhandled rejection - passes but warns ... cancelled ([WILDCARD]) unhandled rejection - passes but warns ... cancelled ([WILDCARD])
async unhandled rejection - passes but warns ... cancelled ([WILDCARD]) async unhandled rejection - passes but warns ... cancelled ([WILDCARD])
immediate throw - passes but warns ... cancelled ([WILDCARD]) immediate throw - passes but warns ... cancelled ([WILDCARD])
@ -108,32 +108,32 @@ unfinished test with unhandledRejection ... cancelled ([WILDCARD])
ERRORS ERRORS
sync fail todo => ./node/test.js:20:1 sync fail todo => ./test.js:20:1
error: Error: thrown from sync fail todo error: Error: thrown from sync fail todo
throw new Error("thrown from sync fail todo"); throw new Error("thrown from sync fail todo");
[WILDCARD] [WILDCARD]
sync fail todo with message => ./node/test.js:25:1 sync fail todo with message => ./test.js:25:1
error: Error: thrown from sync fail todo with message error: Error: thrown from sync fail todo with message
throw new Error("thrown from sync fail todo with message"); throw new Error("thrown from sync fail todo with message");
[WILDCARD] [WILDCARD]
sync throw fail => ./node/test.js:42:1 sync throw fail => ./test.js:42:1
error: Error: thrown from sync throw fail error: Error: thrown from sync throw fail
throw new Error("thrown from sync throw fail"); throw new Error("thrown from sync throw fail");
[WILDCARD] [WILDCARD]
async throw fail => ./node/test.js:53:1 async throw fail => ./test.js:53:1
error: Error: thrown from async throw fail error: Error: thrown from async throw fail
throw new Error("thrown from async throw fail"); throw new Error("thrown from async throw fail");
[WILDCARD] [WILDCARD]
async skip fail => ./node/test.js:64:1 async skip fail => ./test.js:64:1
error: Error: thrown from async throw fail error: Error: thrown from async throw fail
throw new Error("thrown from async throw fail"); throw new Error("thrown from async throw fail");
[WILDCARD] [WILDCARD]
async assertion fail => ./node/test.js:69:1 async assertion fail => ./test.js:69:1
error: AssertionError: Values are not strictly equal: error: AssertionError: Values are not strictly equal:
@ -145,13 +145,13 @@ error: AssertionError: Values are not strictly equal:
at [WILDCARD] at [WILDCARD]
reject fail => ./node/test.js:78:1 reject fail => ./test.js:78:1
error: Error: rejected from reject fail error: Error: rejected from reject fail
return Promise.reject(new Error("rejected from reject fail")); return Promise.reject(new Error("rejected from reject fail"));
^ ^
at [WILDCARD] at [WILDCARD]
./node/test.js (uncaught error) ./test.js (uncaught error)
error: (in promise) Error: rejected from unhandled rejection fail error: (in promise) Error: rejected from unhandled rejection fail
Promise.reject(new Error("rejected from unhandled rejection fail")); Promise.reject(new Error("rejected from unhandled rejection fail"));
^ ^
@ -161,14 +161,14 @@ It most likely originated from a dangling promise, event/timeout handler or top-
FAILURES FAILURES
sync fail todo => ./node/test.js:20:1 sync fail todo => ./test.js:20:1
sync fail todo with message => ./node/test.js:25:1 sync fail todo with message => ./test.js:25:1
sync throw fail => ./node/test.js:42:1 sync throw fail => ./test.js:42:1
async throw fail => ./node/test.js:53:1 async throw fail => ./test.js:53:1
async skip fail => ./node/test.js:64:1 async skip fail => ./test.js:64:1
async assertion fail => ./node/test.js:69:1 async assertion fail => ./test.js:69:1
reject fail => ./node/test.js:78:1 reject fail => ./test.js:78:1
./node/test.js (uncaught error) ./test.js (uncaught error)
FAILED | 9 passed (2 steps) | 51 failed | 4 ignored [WILDCARD] FAILED | 9 passed (2 steps) | 51 failed | 4 ignored [WILDCARD]

View file

@ -0,0 +1,9 @@
{
"args": "test -A --no-check test_no_sanitizers/test.js",
"output": "test_no_sanitizers/test.out",
"envs": {
"NO_COLOR": "1",
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
},
"exitCode": 0
}

View file

@ -0,0 +1,4 @@
const filename = Deno.args[0];
using file = await Deno.open(filename);
await file.readable.pipeTo(Deno.stdout.writable);

View file

@ -1,12 +1,11 @@
import test from "node:test"; import test from "node:test";
test("should not complain about resource and op sanitizers", async (t) => { test("should not complain about resource and op sanitizers", async (t) => {
// resource // resource
const _file1 = Deno.open("welcome.ts"); const _file1 = Deno.open("test_no_sanitizers/welcome.ts");
await t.test("nested test", () => { await t.test("nested test", () => {
// resource // resource
const _file2 = Deno.open("cat.ts"); const _file2 = Deno.open("test_no_sanitizers/cat.ts");
// op // op
crypto.subtle.digest( crypto.subtle.digest(

View file

@ -1,4 +1,4 @@
running 1 test from ./node/test_no_sanitizers/test.js running 1 test from ./test_no_sanitizers/test.js
should not complain about resource and op sanitizers ... should not complain about resource and op sanitizers ...
nested test ... ok ([WILDCARD]) nested test ... ok ([WILDCARD])
should not complain about resource and op sanitizers ... ok ([WILDCARD]) should not complain about resource and op sanitizers ... ok ([WILDCARD])

View file

@ -0,0 +1 @@
console.log("Welcome to Deno!");

View file

@ -0,0 +1,5 @@
{
"args": "run events_order.ts",
"output": "events_order.out",
"exitCode": 0
}

View file

@ -214,7 +214,7 @@ async function ensureNoNewITests() {
"lint_tests.rs": 18, "lint_tests.rs": 18,
// Read the comment above. Please don't increase these numbers! // Read the comment above. Please don't increase these numbers!
"lsp_tests.rs": 0, "lsp_tests.rs": 0,
"node_compat_tests.rs": 4, "node_compat_tests.rs": 0,
"node_unit_tests.rs": 2, "node_unit_tests.rs": 2,
"npm_tests.rs": 92, "npm_tests.rs": 92,
"pm_tests.rs": 0, "pm_tests.rs": 0,
@ -227,7 +227,7 @@ async function ensureNoNewITests() {
"upgrade_tests.rs": 0, "upgrade_tests.rs": 0,
"vendor_tests.rs": 1, "vendor_tests.rs": 1,
"watcher_tests.rs": 0, "watcher_tests.rs": 0,
"worker_tests.rs": 18, "worker_tests.rs": 0,
}; };
const integrationDir = join(ROOT_PATH, "tests", "integration"); const integrationDir = join(ROOT_PATH, "tests", "integration");
for await (const entry of Deno.readDir(integrationDir)) { for await (const entry of Deno.readDir(integrationDir)) {