Skip to content

A TypeScript scaffolding project to test Mocha code generated from APICove

License

Notifications You must be signed in to change notification settings

la-rebelion/apicove-mocha-ts-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Mocha TypeScript Project

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! ✊🏽

Project Structure

my-mocha-ts-project
├── src
│   └── index.ts
├── test
│   └── index.test.ts
├── package.json
├── tsconfig.json
└── README.md

Files

src/index.ts

This file is the entry point of the application. It contains the main code that you want to test.

test/index.test.ts

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.

tsconfig.json

This file is the configuration file for TypeScript. It specifies the compiler options and the files to include in the compilation.

package.json

This file is the configuration file for yarn/npm. It lists the dependencies and scripts for the project.

Getting Started

NOTE: Use yarn preferably, but you can use npm as well. I had issues with npm and npx when running the tests. @fixme ⚠️

  1. Clone this repository.
  2. Install the dependencies by running npm install or yarn install.
  3. Run the tests by running npm test or yarn test.

Codespaces

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! ✊🏽

License

This project is licensed under the MIT License. See the LICENSE file for details.