- WSL (Ubuntu 25.10)
- Node v25.9.0
- PNPM 10.30.3
tsc converts TypeScript to JavaScript and run the file.
$ pnpm install typescript
$ pnpm tsc --noEmit
$ node ./lib/user_account.js
=> ID: 1, Name: User1ts-node directly runs TypeScript file.
$ pnpm dlx ts-node ./lib/user_account.ts
=> ID: 1, Name: User1$ pnpm initYou will be asked some questions, but just keep tapping "Enter" key.
$ pnpm install --save-dev jest babel-jest babel-core @babel/core @babel/preset-env$ pnpm install --save-dev jest babel-jestTo execute all unit tests, run pnpm exec jest.
$ pnpm exec jest
PASS __tests__/hello.test.js (24.047 s)
✓ Hello (3 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 48.781 s
Ran all test suites.To execuate a unittest, run pnpm exec jest ./__test__/{filename}_test.js.
$ pnpm exec jest ./basic/__tests__/hello_test.js
PASS basic/__tests__/hello_test.js (15.283 s)
✓ hello (2 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 38.076 s
Ran all test suites matching /basic\/__tests__\/hello_test.js/i.