$ cnpm install ismocha
ismocha checks whether code is run using Mocha.
| Category | Status |
|---|---|
| Version | |
| Dependencies | |
| Dev dependencies | |
| Build | |
| License |
$ npm install ismocha
First you need to integrate ismocha into your application.
const { isMocha } = require('ismocha');
If you use TypeScript, use the following code instead:
import { isMocha } from 'ismocha';
Then call the isMocha function. If you run this in a process started by Mocha, the function will return true; otherwise it will return false:
if (isMocha()) {
// ...
}
To run quality assurance for this module use roboter:
$ npx roboter
Copyright 2013 - present © cnpmjs.org | Home |