New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

trigger-mocha-tests

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trigger-mocha-tests

This package allows you to run your Mocha tests programmatically, without any human intervention..

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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

  • Add trigger-mocha-tests to your project
npm install trigger-mocha-tests --save
  • 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);
  • Finally, run your tests with the below command
node <fileName>

Output

Output in the terminal would show the status of test, and reports would be stored in .xml within the reports folder.

Keywords

mocha

FAQs

Package last updated on 21 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts