Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ To run the tests you have set up, do the following:
$ deno test --allow-read --allow-run node/_tools/test.ts
```

If you want to run specific tests in a local environment, add `--only` flag to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice doc 👍

the `node/_tools/config.json` as follows:

```json
...
"tests": {
"parallel": [
...
"test-event-emitter-add-listeners.js",
"test-event-emitter-check-listener-leaks.js --only",
"test-event-emitter-invalid-listener.js",
...
]
}
...
```

The test should be passing with the latest deno, so if the test fails, try the
following:

Expand Down
6 changes: 5 additions & 1 deletion node/_tools/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import { config, testList } from "./common.ts";
* code for the test is reported, the test suite will fail immediately
*/

const onlyFlagTestList = config.tests.parallel.filter((filename) =>
filename.match("--only")
).map((filename) => new RegExp(filename.replace(/ --only/, "")));

const dir = walk(fromFileUrl(new URL(config.suitesFolder, import.meta.url)), {
includeDirs: false,
match: testList,
match: onlyFlagTestList.length ? onlyFlagTestList : testList,
});

const testsFolder = dirname(fromFileUrl(import.meta.url));
Expand Down