this is a simple project in order to learn how to use tap with Typescript
a quick solution was presented tapjs/tapjs#679 (comment)
that made things working correctly with a bit tweaking that can be seen on #1
just added example so everyone can see that both c8 tap and c8 tap ./test/**/*.spec.ts pass
if one runs npm i and then npm test this is the error that the test throws
./test/ping.spec.ts 2> TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/balexandre/Repositories/tap/test/ping.spec.ts
./test/ping.spec.ts 2> at new NodeError (node:internal/errors:399:5)
./test/ping.spec.ts 2> at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
./test/ping.spec.ts 2> at defaultGetFormat (node:internal/modules/esm/get_format:121:38)
./test/ping.spec.ts 2> at defaultLoad (node:internal/modules/esm/load:81:20)
./test/ping.spec.ts 2> at nextLoad (node:internal/modules/esm/loader:163:28)
./test/ping.spec.ts 2> at ESMLoader.load (node:internal/modules/esm/loader:605:26)
./test/ping.spec.ts 2> at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
./test/ping.spec.ts 2> at new ModuleJob (node:internal/modules/esm/module_job:64:26)
./test/ping.spec.ts 2> at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:480:17)
./test/ping.spec.ts 2> at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34) {
./test/ping.spec.ts 2> code: 'ERR_UNKNOWN_FILE_EXTENSION'
./test/ping.spec.ts 2> }
โ FAIL โ ./test/ping.spec.ts 255.894ms
command: /home/balexandre/.nvm/versions/node/v18.14.0/bin/node
args:
- -r
- /home/balexandre/Repositories/tap/node_modules/ts-node/register/index.js
- ./test/ping.spec.ts
exitCode: 1
signal: null
โ FAIL โ TAP
โ ./test/ping.spec.ts
test: TAP
env:
TS_NODE_COMPILER_OPTIONS: "{}"
file: ./test/ping.spec.ts
timeout: 30000
command: /home/balexandre/.nvm/versions/node/v18.14.0/bin/node
args:
- -r
- /home/balexandre/Repositories/tap/node_modules/ts-node/register/index.js
- ./test/ping.spec.ts
stdio:
- 0
- pipe
- 2
cwd: /home/balexandre/Repositories/tap
exitCode: 1
๐ SUMMARY RESULTS ๐
โ FAIL โ ./test/ping.spec.ts 255.894ms
command: /home/balexandre/.nvm/versions/node/v18.14.0/bin/node
args:
- -r
- /home/balexandre/Repositories/tap/node_modules/ts-node/register/index.js
- ./test/ping.spec.ts
exitCode: 1
signal: null
Suites: โ1 failedโ, โ1 of 1 completedโ
Asserts: โโโ1 failedโ, โof 1โ
โTime:โ โ393.891msโ----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------