diff options
| author | Hirotaka Tagawa / wafuwafu13 <jaruwafu@gmail.com> | 2023-06-01 09:31:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-01 17:31:06 +0900 |
| commit | 1a0445dc6baf9632870156d7509a339857dd4f37 (patch) | |
| tree | 5393a1b81d3f722045ba29102b7976df024cfdbd /tools/node_compat | |
| parent | befd03a3f074a50c4e0e7b2833c676c04683ddde (diff) | |
chore(node_compat): add deno task for setting up and running tests (#19293)
Diffstat (limited to 'tools/node_compat')
| -rw-r--r-- | tools/node_compat/README.md | 14 | ||||
| -rw-r--r-- | tools/node_compat/deno.json | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/tools/node_compat/README.md b/tools/node_compat/README.md index c422a1d0e..29a7ef739 100644 --- a/tools/node_compat/README.md +++ b/tools/node_compat/README.md @@ -20,10 +20,10 @@ Node.js compat testing in Deno repository. ## Steps to add new test cases from Node.js test cases 1. Update `tests` property of `//cli/tests/node_compat/config.jsonc`. For - example, if you want to add `test/paralles/test-foo.js` from Node.js test + 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` -1. Run `./tools/node_compat/setup.ts` +1. Run `deno task setup` in `tools/node_compat` dir. The above command copies the updated items from Node.js tarball to the Deno source tree. @@ -40,4 +40,12 @@ If the test needs to be ignored in particular platform, then add them in 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`. +`cargo test node_compat`. If you want to run specific tests you can use the +command `deno task test` (in `tools/node_comapt` dir). For example, if you want +to run all test files which contains `buffer` in filename you can use the +command: + +```shellsession +/path/to/deno/tools/node_compat +$ deno task test buffer +``` diff --git a/tools/node_compat/deno.json b/tools/node_compat/deno.json new file mode 100644 index 000000000..6e9c891a0 --- /dev/null +++ b/tools/node_compat/deno.json @@ -0,0 +1,6 @@ +{ + "tasks": { + "setup": "deno run --allow-read --allow-write ./setup.ts", + "test": "deno test -A ../../cli/tests/node_compat/test.ts --" + } +} |
