https://github.com/dikshita25/trigger-mocha-tests
This package allows you to run your Mocha tests programmatically, without any human intervention..
https://github.com/dikshita25/trigger-mocha-tests
Last synced: 4 months ago
JSON representation
This package allows you to run your Mocha tests programmatically, without any human intervention..
- Host: GitHub
- URL: https://github.com/dikshita25/trigger-mocha-tests
- Owner: Dikshita25
- Created: 2022-01-21T10:02:48.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T10:17:26.000Z (over 3 years ago)
- Last Synced: 2025-01-27T04:33:44.243Z (4 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Trigger Mocha tests programmatically
This package allows you to run your Mocha tests programmatically, without any human intervention..### Features
* Allows triggering mocha tests programmatically
* Supports parallel mode of execution
* Allows testing single/multiple files or entire folder which needs to be tested
* Reports are generated in xml format### Usage
1. Add `trigger-mocha-tests` to your project
```
npm install trigger-mocha-tests --save
```
2. Tell the runner, about the test folder path or files and the reports folder path inside a `.js` file**Note:Specifying the testFiles is optional, if not specified will pick all the files under the test folder**
```
const triggerMochaTest = require("trigger-mocha-tests");const config = {
reportFolderPath: './reports',
testFolderPath: './tests',
testFiles: ['test1', 'test2']
};triggerMochaTest(config);
```
3. Finally, run your tests with the below command```
node
```### Output
Output in the terminal would show the status of test, and reports would be stored in `.xml` within the `reports` folder.