Skip to content

Repository files navigation

JS/TS Learning Project

A progressive, test-first curriculum: every exercise ships with a Vitest test file from day one.

Setup

npm install
npm test              # run all tests once
npm run test:watch    # re-run on file changes (use this while coding)
npm run test:coverage # see what % of your code is actually tested
npm run typecheck     # check TypeScript phases for type errors

Viewing reports

There are two different HTML-based reports — make sure you're looking at the right one.

HTML test results (browser UI)

npm run test -- --reporter=html   # or add --reporter=html to any vitest run
npx vite preview --outDir html    # then open the printed http://localhost:4173/ URL

HTML coverage report

npm run test:coverage
open coverage/index.html   # macOS; on Linux/WSL use `xdg-open coverage/index.html`

Allure report

Allure is optional and off by default. To enable it:

  1. In vitest.config.ts, uncomment the two Allure lines:
    reporters: ["default", ["allure-vitest/reporter", { resultsDir: "allure-results" }]],
    setupFiles: ["allure-vitest/setup"],
  2. Run the tests, then generate and open the report:
    npm test                 # writes results into allure-results/
    npx allure generate allure-results -o allure-report --clean
    npx allure open allure-report

Folder map

Folder Topic Status
01-js-basics variables, functions, arrays, objects starter exercise included
02-js-oop classes, inheritance, encapsulation starter exercise included
03-js-async callbacks, Promises, async/await starter exercise included
04-js-filesystem Node fs module, JSON persistence starter exercise included
05-ts-fundamentals types, interfaces, generics starter exercise included (TS version of 01)
06-ts-oop typed classes, access modifiers starter exercise included (TS version of 02)
07-database SQLite CRUD with better-sqlite3 starter exercise included
08-ai-integration calling an AI API, mocking it in tests starter + guidance, no API key included
09-capstone combine everything into one small app empty — up to you

How to use each folder

  1. Open src/ — read the starter file, it has // TODO comments where you fill in logic.
  2. Open tests/ — the test file is already written and describes the expected behavior. Run npm run test:watch and make the tests pass.
  3. Once green, try breaking your own implementation on purpose (off-by-one, wrong type, etc.) and watch the test catch it — this is the habit that matters most for you as a future test-writer.
  4. When you're comfortable, add 2-3 new test cases yourself before moving to the next folder — edge cases, invalid input, empty input.

Suggested pace

Roughly one folder every 2-4 days if you're doing this alongside a job. Don't rush past 01-04 (plain JS) — everything after depends on those being solid.

About

Learning Repository for getting hands on with javascript , typescript and quickly getting hands on experience with writing tests using Vitest framework

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages