From 1a0445dc6baf9632870156d7509a339857dd4f37 Mon Sep 17 00:00:00 2001 From: Hirotaka Tagawa / wafuwafu13 Date: Thu, 1 Jun 2023 09:31:06 +0100 Subject: chore(node_compat): add deno task for setting up and running tests (#19293) --- tools/node_compat/README.md | 14 +++++++++++--- tools/node_compat/deno.json | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 tools/node_compat/deno.json (limited to 'tools/node_compat') 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 --" + } +} -- cgit v1.2.3