SkillAgentSearch skills...

TSUnitTestsSetup

Starter code to create unit tests in typescript using Jasmine, Mocha/Chai, Jest or Vitest

Install / Use

/learn @ChiragRupani/TSUnitTestsSetup
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Typescript unit tests

This repository contains 4 Projects:

  1. HelloJasmine
  2. HelloMocha
  3. HelloJest
  4. HelloVitest

Each project contains sample source code in src folder and unit tests in tests folder.

The goal is to create starter project using typescript and above testing frameworks along with debugging in VS Code and getting code coverage

<hr/>

Manually Setting up projects

The .\installCmd.sh file contains npm install commands if you want to use same npm package in your existing projects.

The .vscode\launch.json file contains settings for debugging the code in VS Code editor.

The .\Package.json file contains scripts for executing tests.

Example:

"scripts": {
    "test": "mocha -r ts-node/register tests/**/*.test.ts"
}

Also,.\tsconfig.json file is generated using tsc --init command

<hr/>

Test Execution

The tests are executed using

npm t

(which is short for npm run test)

To get test coverage

npm run coverage
<hr/>

If you get error - describe is not defined, add mocha or jasmine as shown below in ts.config:

"compilerOptions": {
    "types": [
      "mocha"
    ]
}
View on GitHub
GitHub Stars91
CategoryDevelopment
Updated17h ago
Forks34

Languages

TypeScript

Security Score

95/100

Audited on Apr 5, 2026

No findings