This project contains tests written using Jest and TypeScript. Follow these steps to run them:
Make sure you have:
- Node.js: (LTS version recommended) - Download from https://nodejs.org/
- npm (Comes with Node.js) or yarn (install separately:
npm install -g yarn)
-
Navigate to the Project Directory: Open your terminal or command prompt and go to the project folder.
cd path/to/your/practice-project -
Install Dependencies: If you haven't, install the project dependencies.
npm install # or yarn install -
Compile TypeScript: Compile the
.tsfiles to.js.npx tsc # or yarn tsc -
Run All Tests: To run all tests in the project:
npm test # or yarn test
-
Run a Specific Test File: To run tests in a single file (e.g.,
1.tipe-data.test.js):npm test 1.tipe-data.test.js # or yarn test 1.tipe-data.test.js
Important: Use the compiled
.jsfile name.
Now you should be able to run the tests for your TypeScript practice project.