Lesson 1 of 9

Lesson 01 — Setup environment for TypeScript QA work

Title: Node.js, editor, Git, and your first typed project

Description: Install the toolchain QA automation engineers use daily, scaffold a tiny TypeScript project, and run .ts files without compiling manually each time.

Why it matters for QA: Interview tasks and real repos expect Node projects with typescript, editors that surface type errors early, and repeatable commands (npm test, npx playwright test). Getting comfortable here removes friction before Playwright.


1. Install core tools

  • Node.js (LTS) — ships npm and runs Playwright test runners locally.
  • VS Code — TypeScript language service built in; extensions optional (ESLint, Playwright).
  • Git (optional but recommended) — clone starter repos and submit homework via branches.

2. Create the practice folder

From a terminal:

bashbash
mkdir ts-qa-course
cd ts-qa-course
npm init -y
npm install typescript ts-node @types/node --save-dev
npx tsc --init

What you added:

PackageRole
typescriptCompiler tsc and type checker
ts-nodeExecute .ts files directly in Node
@types/nodeTypes for process, Buffer, module APIs

3. Minimal index.ts

Create index.ts beside package.json:

typescripttypescript
const role: string = "QA Engineer";
console.log(`Starting lab as ${role}`);

Run it:

bashbash
npx ts-node index.ts

You should see the greeting in the terminal.


4. Peek at tsconfig.json

After tsc --init, open tsconfig.json. For QA labs you usually keep defaults first, then tighten later (strict, moduleResolution). Knowing this file exists matters when CI fails only on the build server.


5. Practice checklist

  1. Confirm node -v prints an even major (LTS line).
  2. Run npx ts-node index.ts successfully.
  3. Deliberately remove : string from role, assign 123, and read the compiler error — that feedback loop is your mentor.

6. Stretch goal

Add an npm script in package.json:

jsonjson
"scripts": {
  "start": "ts-node index.ts"
}

Run npm run start. Same output, repeatable command teammates recognize.