15 / 80 · 12 Programming for QA · JavaScript and TypeScript for QA← prev⊞ allnext →☰ Read as one page
2.7TypeScript Configuration for Test Projects
// tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "./dist",
"rootDir": "./src",
"types": ["jest", "node"]
},
"include": ["src/**/*", "tests/**/*"]
}
Running TypeScript Directly on Node.js
As of July 2026, Node.js 24 is the active LTS release, and its native TypeScript type-stripping is stable: node app.ts just runs, no ts-node or build step required. (Node.js 26 is the Current release, and starting with Node 27 the project moves to one major release per year.)
One critical caveat: type-stripping only removes the type annotations -- it does not type-check. A test suite can run "green" on node app.ts while containing type errors. Keep tsc --noEmit as a separate CI step so the compiler still verifies your types:
# Run a TypeScript script directly (Node.js 24 LTS)
node scripts/seed-test-data.ts
# Type-check in CI -- type-stripping alone will not catch type errors
npx tsc --noEmit