Skip to content

Commit

Permalink
chore: deprecate node compat itests (#25573)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadSu1 authored Sep 16, 2024
1 parent e4ea9be commit eb8ee95
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 63 deletions.
2 changes: 0 additions & 2 deletions tests/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ mod jupyter;
mod lint;
#[path = "lsp_tests.rs"]
mod lsp;
#[path = "node_compat_tests.rs"]
mod node_compat_tests;
#[path = "node_unit_tests.rs"]
mod node_unit_tests;
#[path = "npm_tests.rs"]
Expand Down
37 changes: 0 additions & 37 deletions tests/integration/node_compat_tests.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"args": "run process_beforeexit_exit_events.ts",
"output": "process_beforeexit_exit_events.out",
"exitCode": 0
}
9 changes: 9 additions & 0 deletions tests/specs/node_compat_tests/node_test_module/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"args": "test test.js",
"output": "test.out",
"envs": {
"NO_COLOR": "1",
"NPM_CONFIG_REGISTRY": "http://localhost:4260/"
},
"exitCode": 1
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[WILDCARD]
running 63 tests from ./node/test.js
running 63 tests from ./test.js
sync pass todo ...
------- output -------
Warning: Not implemented: test.TestContext.todo
Expand Down Expand Up @@ -57,7 +57,7 @@ async assertion fail ... FAILED [WILDCARD]
resolve pass ... ok [WILDCARD]
reject fail ... FAILED [WILDCARD]
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])
async unhandled rejection - passes but warns ... cancelled ([WILDCARD])
immediate throw - passes but warns ... cancelled ([WILDCARD])
Expand Down Expand Up @@ -108,32 +108,32 @@ unfinished test with unhandledRejection ... cancelled ([WILDCARD])

ERRORS

sync fail todo => ./node/test.js:20:1
sync fail todo => ./test.js:20:1
error: Error: thrown from sync fail todo
throw new Error("thrown from sync fail todo");
[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
throw new Error("thrown from sync fail todo with message");
[WILDCARD]

sync throw fail => ./node/test.js:42:1
sync throw fail => ./test.js:42:1
error: Error: thrown from sync throw fail
throw new Error("thrown from sync throw fail");
[WILDCARD]

async throw fail => ./node/test.js:53:1
async throw fail => ./test.js:53:1
error: Error: thrown from async throw fail
throw new Error("thrown from async throw fail");
[WILDCARD]

async skip fail => ./node/test.js:64:1
async skip fail => ./test.js:64:1
error: Error: thrown from async throw fail
throw new Error("thrown from async throw fail");
[WILDCARD]

async assertion fail => ./node/test.js:69:1
async assertion fail => ./test.js:69:1
error: AssertionError: Values are not strictly equal:


Expand All @@ -145,13 +145,13 @@ error: AssertionError: Values are not strictly equal:

at [WILDCARD]

reject fail => ./node/test.js:78:1
reject fail => ./test.js:78:1
error: Error: rejected from reject fail
return Promise.reject(new Error("rejected from reject fail"));
^
at [WILDCARD]

./node/test.js (uncaught error)
./test.js (uncaught error)
error: (in promise) Error: rejected from unhandled rejection fail
Promise.reject(new Error("rejected from unhandled rejection fail"));
^
Expand All @@ -161,14 +161,14 @@ It most likely originated from a dangling promise, event/timeout handler or top-

FAILURES

sync fail todo => ./node/test.js:20:1
sync fail todo with message => ./node/test.js:25:1
sync throw fail => ./node/test.js:42:1
async throw fail => ./node/test.js:53:1
async skip fail => ./node/test.js:64:1
async assertion fail => ./node/test.js:69:1
reject fail => ./node/test.js:78:1
./node/test.js (uncaught error)
sync fail todo => ./test.js:20:1
sync fail todo with message => ./test.js:25:1
sync throw fail => ./test.js:42:1
async throw fail => ./test.js:53:1
async skip fail => ./test.js:64:1
async assertion fail => ./test.js:69:1
reject fail => ./test.js:78:1
./test.js (uncaught error)

FAILED | 9 passed (2 steps) | 51 failed | 4 ignored [WILDCARD]

Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const filename = Deno.args[0];
using file = await Deno.open(filename);

await file.readable.pipeTo(Deno.stdout.writable);
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import test from "node:test";

test("should not complain about resource and op sanitizers", async (t) => {
// resource
const _file1 = Deno.open("welcome.ts");
const _file1 = Deno.open("test_no_sanitizers/welcome.ts");

await t.test("nested test", () => {
// resource
const _file2 = Deno.open("cat.ts");
const _file2 = Deno.open("test_no_sanitizers/cat.ts");

// op
crypto.subtle.digest(
Expand Down
Original file line number Diff line number Diff line change
@@ -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 ...
nested test ... ok ([WILDCARD])
should not complain about resource and op sanitizers ... ok ([WILDCARD])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Welcome to Deno!");
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"args": "run events_order.ts",
"output": "events_order.out",
"exitCode": 0
}
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tools/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ async function ensureNoNewITests() {
"lint_tests.rs": 18,
// Read the comment above. Please don't increase these numbers!
"lsp_tests.rs": 0,
"node_compat_tests.rs": 4,
"node_compat_tests.rs": 0,
"node_unit_tests.rs": 2,
"npm_tests.rs": 92,
"pm_tests.rs": 0,
Expand All @@ -227,7 +227,7 @@ async function ensureNoNewITests() {
"upgrade_tests.rs": 0,
"vendor_tests.rs": 1,
"watcher_tests.rs": 0,
"worker_tests.rs": 18,
"worker_tests.rs": 0,
};
const integrationDir = join(ROOT_PATH, "tests", "integration");
for await (const entry of Deno.readDir(integrationDir)) {
Expand Down

0 comments on commit eb8ee95

Please sign in to comment.