Closed
Description
Details
I want to replace Mocha tests with the built-in testrunner. All tests are inside a test directory and follow the pattern
...Tests.ts
I started with a fooTests.ts file
import assert from 'assert/strict';
import test from 'node:test';
test('1 is equal to 1.', () => {
assert.strictEqual(1, 1);
});
and added the npm script
"test": "node --test ./test/**/*Tests.ts",
The script fails with the message
Could not find '/home/.../test/**/*Tests.ts'
How can I fix the script to
- test files matching the path
./test/**/*Tests.ts
only - run with TS files ( I'm pretty sure I must use ts-node for this )
? Thanks in advance!
Node.js version
v18
Operating system
Linux ( Ubuntu 22.04 )
Scope
Built-in testrunner
Module and version
Not applicable.
Metadata
Metadata
Assignees
Labels
No labels