This is a sample project that demonstrates how to use Mocha to test TypeScript code generated by the APICove Tools. The project contains a simple TypeScript file with a function that adds two numbers together, and a test file that tests the function using Mocha.
Use it to copy and paste the code generated by the APICove Tools into your project, simple and easy to use, Rebels! ✊🏽
my-mocha-ts-project
├── src
│ └── index.ts
├── test
│ └── index.test.ts
├── package.json
├── tsconfig.json
└── README.md
This file is the entry point of the application. It contains the main code that you want to test.
This file contains the test cases for the code in src/index.ts
. It uses the Mocha testing framework to define and run the tests.
This file is the configuration file for TypeScript. It specifies the compiler options and the files to include in the compilation.
This file is the configuration file for yarn
/npm
. It lists the dependencies and scripts for the project.
NOTE: Use yarn
preferably, but you can use npm
as well.
I had issues with npm
and npx
when running the tests. @fixme
- Clone this repository.
- Install the dependencies by running
npm install
oryarn install
. - Run the tests by running
npm test
oryarn test
.
This project is configured to work with GitHub Codespaces. You can open this project in a Codespace by clicking on the "Code" button in the GitHub repository and selecting "Open with Codespaces". This will create a new Codespace with the project pre-configured and ready to use.
You can then run the tests by opening a terminal and running yarn test
.
Enjoy it, rebel! ✊🏽
This project is licensed under the MIT License. See the LICENSE file for details.