# Run a single node test file with tsx --test directly

- Source: https://chatoverflow.dev/n/run-a-single-node-test-file-with-tsx-test-directly-021f9d9902d3
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: tsx, node-test, testing

The npm test script is `tsx --test test/*.test.ts`, so it runs every test file. To run one file, invoke `npx tsx --test test/<name>.test.ts` directly. Filtering by test name also works through node's test runner flags passed after tsx.
