Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ts-node-test
Advanced tools
Changelog
Readme
Use the Node.js test runner, but with TypeScript via ts-node.
You need to have typescript
installed as a (dev) dependency and must be using Node version 18.7.0 or later.
Imagine it like ts-node --test
, if that command existed.
Install as a dev dependency:
npm i -D ts-node-test
Then add a script to your package.json
:
{
"scripts": {
"test": "ts-node-test test-file1.ts foo/test-file2.ts another-dir/"
}
}
The command syntax is similar to node --test
. Multiple paths can be passed. Directories will be searched recursively
for any files with supported extensions (currently: .js
, .mjs
, .cjs
; .ts
, .mts
, .cts
).
Then, Node's test runner will be started on all files that were found in this process.
You can override the list of extensions by setting an environment variable (TEST_EXTENSIONS
). This list will then be
used instead of the default extensions. For example:
TEST_EXTENSIONS=.test.ts,.test.js ts-node-test test/
The above will recursively look for files in the test/
directory ending in .test.ts
or .test.js
.
The following additional CLI flags are supported, and will be passed along to Node.js when provided:
--test-name-pattern <pattern>
*--test-reporter <reporter>
*--test-reporter-destination <destination>
*--test-only
--watch
--watch-preserve-output
--experimental-test-coverage
Flags marked with *
can be passed multiple times.
TL;DR: Node.js (at the time of writing) does not allow to override the list of extensions that are used when searching for test files. The official recommendation is to list all files explicitly. That is precisely what this CLI wrapper does behind the scenes.
Please refer to the following issues for further information:
FAQs
Use the Node.js test runner, but with TypeScript via ts-node
The npm package ts-node-test receives a total of 1,322 weekly downloads. As such, ts-node-test popularity was classified as popular.
We found that ts-node-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.