1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 13:22:55 -05:00
denoland-deno/tests/node_compat/runner
Satya Rohith 960776cd32
fix(ext/node): support createConnection option in node:http.request() (#25470)
This commit changes "node:http" module to add support
for the "createConnection" option when the "request()"
API is called.


Closes https://github.com/denoland/deno/issues/19507

---------

Signed-off-by: Yoshiya Hinosawa <stibium121@gmail.com>
Signed-off-by: Satya Rohith <me@satyarohith.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-12-13 01:44:42 +01:00
..
suite@1c9511e584 chore: update node_compat setup script (#27051) 2024-11-25 22:35:53 +09:00
.gitignore chore: move tools/node_compat to tests/node_compat/runner (#23025) 2024-04-03 09:24:55 +11:00
challenge_new_test.ts chore: add script to check remaining node compat cases (#27122) 2024-12-06 15:22:33 +09:00
deno.json chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
README.md chore: move tools/node_compat to tests/node_compat/runner (#23025) 2024-04-03 09:24:55 +11:00
setup.ts chore: add script to check remaining node compat cases (#27122) 2024-12-06 15:22:33 +09:00
TODO.md fix(ext/node): support createConnection option in node:http.request() (#25470) 2024-12-13 01:44:42 +01:00

Tools for Node.js compatibility work

We run native Node.js test cases against our Node.js compatibility feature.

This directory includes the tools for downloading, setting up, and updating the Node.js compat testing in Deno repository.

  • //tests/node_compat/runner/setup.ts
    • This script sets up the Node.js compat tests.
  • //tests/node_compat/runner/versions/
    • Node.js source tarballs and extracted test cases are stored here.
  • //tests/node_compat/config.jsonc
    • This json file stores the settings about which Node.js compat test to run with Deno.
  • //tests/node_compat/test
    • The actual test cases are stored here.

Steps to add new test cases from Node.js test cases

  1. Update tests property of //tests/node_compat/config.jsonc. For example, if you want to add test/parallel/test-foo.js from Node.js test cases, then add test-foo.js entry in tests.parallel array property in config.jsonc
  2. Run deno task setup in tests/node_compat/runner dir.

The above command copies the updated items from Node.js tarball to the Deno source tree.

Ideally Deno should pass the Node.js compat tests without modification, but if you need to modify it, then add that item in ignore property of config.jsonc. Then setup.ts doesn't overwrite the modified Node.js test cases anymore.

If the test needs to be ignored in particular platform, then add them in ${platform}Ignore property of config.jsonc

Run Node.js test cases

Node.js compat tests are run as part of cargo test command. If you want to run only the Node.js compat test cases you can use the command cargo test node_compat. If you want to run specific tests you can use the command deno task test (in tests/node_compat/runner dir). For example, if you want to run all test files which contains buffer in filename you can use the command:

/path/to/deno/tests/node_compat/runner
$ deno task test buffer