# @zordok/mjs-mocha

> Simple (very) polyfill to emulate mocha tests in mjs environment. For use simply import

Latest version **1.1.1** (published 2020-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install @zordok/mjs-mocha
pnpm add @zordok/mjs-mocha
yarn add @zordok/mjs-mocha
bun add @zordok/mjs-mocha
```

Provides the command `mjs-mocha`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-09-02 |
| First published | 2020-09-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 64.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nikita Eliseev |
| Maintainers | zordok |
| Keywords | mocha, mjs, tests, polyfill |

## Links

- npm: https://www.npmjs.com/package/@zordok/mjs-mocha
- Repository: https://github.com/EliseevNP/mjs-mocha
- Homepage: https://github.com/EliseevNP/mjs-mocha#readme
- Issues: https://github.com/EliseevNP/mjs-mocha/issues
- npm.io page: https://npm.io/package/@zordok/mjs-mocha

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2020-09-02
- 1.1.0 — 2020-09-02
- 1.0.7 — 2020-09-02

## README

# @eliseevnp/mjs-mocha
A very simple npm mocha mjs polyfill. No dependencies at all. Very small and light.

## Install
```shell
$ npm i -D @eliseevnp/mjs-mocha
```

## Usage
### Import

```js
import '@eliseevnp/mjs-mocha';

describe('My test', () => {
  ...
})
```

### CLI
Add the script to your `package.json`.

```json
{
  "scripts": {
    "test:mjs": "mjs-mocha --extension mjs",
    "test:js": "mjs-mocha --extension js"
  }
}
```

Then just run `npm test:mjs` or `npm test:js`.

mjs-mocha will run all files that match by specifying extension. Default regexp matches all `*.test.mjs` and `*.spec.mjs` files in your repository. If you want matching all `*.test.js` and `*.spec.js` files in your repository you must provide `--extension js` option.

Also you can specify test files to run by passing them as arguments.

#### Example
project structure:
- src
  - ...
- tests
  - first.test.mjs
  - second.test.mjs
  - third.test.mjs

```shell
mjs-mocha first second
```

---
_Source: https://npm.io/package/@zordok/mjs-mocha · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
