deno/tests/node_compat
Bartek Iwańczuk 3df3f275df
fix(ext/node): fix hot loop in setImmediate with a pending timer (#31643)
Contains fix from https://github.com/denoland/deno_core/pull/1263.

This effectively reopens https://github.com/denoland/deno/issues/28016
for the time being as we're regressing one of the Node.js compat tests
and the interaction between `setTimeout` and `setImmediate` is a bit
broken, but it unblocks `puppeteer` usage for the time being.

Fixes https://github.com/denoland/deno/issues/31642
Fixes https://github.com/denoland/deno/issues/31595
Fixes https://github.com/denoland/deno/issues/30960
2025-12-17 17:13:54 +01:00
..
runner chore: update Node.js test suite to 24.12.0 (#31628) 2025-12-16 13:59:36 -08:00
.gitignore chore: create monthly summary of node test runs (#28778) 2025-04-08 12:12:27 +09:00
add_day_summary_to_month_summary.ts chore: post node test results to slack (#28795) 2025-04-08 23:14:38 +09:00
common.ts chore(test): add reason field to node compat test config (#30469) 2025-09-01 23:44:11 +02:00
config.toml fix(ext/node): fix hot loop in setImmediate with a pending timer (#31643) 2025-12-17 17:13:54 +01:00
deno.json chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
README.md chore(test): add reason field to node compat test config (#30469) 2025-09-01 23:44:11 +02:00
run_all_test_unmodified.ts ci: increase node compat test timeout on Mac Intel (#31538) 2025-12-09 09:23:37 +00:00
semaphore.ts chore: make node compat tests run sequentially on first failure (#31142) 2025-10-30 13:40:07 -04:00
slack.ts ci: update Slack bot action (#29333) 2025-05-16 15:00:10 +02:00
test.ts chore: make node compat tests run sequentially on first failure (#31142) 2025-10-30 13:40:07 -04:00
test_runner.rs Revert "ci: skip running WPT and node compat unless labels present (#… (#31120) 2025-10-28 22:18:56 +00:00

Node compat test directory

This directory includes the tools for running Node.js test cases directly in Deno.

  • ./runner/suite/ - vendored Node.js test cases (git submodule at https://github.com/denoland/node_test)
  • ./config.toml - has the list of passing Node.js test cases
  • ./test.ts - The script entrypoint of node compat test.

If you run single node.js test case, use the command:

./tools/node_compat_tests.js --filter <name of test file>

Configuration file

The config.toml specifies which tests should pass in Deno and includes platform-specific and behavioral settings for each test.

Options

Each test entry can include the following optional configuration properties:

  • flaky (boolean): Marks a test as flaky. It will be run at most 3 times before being considered failed.

  • windows (boolean): Controls whether the test should run on Windows. Defaults to true.

  • darwin (boolean): Controls whether the test should run on macOS. Defaults to true.

  • linux (boolean): Controls whether the test should run on Linux. Defaults to true.

  • reason (string): Optional explanation for why a test is marked as skipped.

Examples

# Should pass on all platforms
"parallel/test-foo.js" = {}

# Test marked as flaky
"parallel/test-bar.js" = { flaky = true }

# Test skipped on all platforms with explanation
"parallel/test-baz.js" = { darwin = false, linux = false, windows = false, reason = "some reason" }

# Test skipped only on Windows
"parallel/test-qux.js" = { windows = false }

Add test case entry to CI check

If you fixed some Node.js compabitility and some test cases started passing, then add those cases to config.toml. The items listed in there are checked in CI check.

Daily test viewer

To see the latest test results of all test cases, visit this site https://node-test-viewer.deno.dev/results/latest