# browser-test-mocha

> Sets up a test server using Mocha and Chai to test against a browser environment

Latest version **1.0.2** (published 2020-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install browser-test-mocha
pnpm add browser-test-mocha
yarn add browser-test-mocha
bun add browser-test-mocha
```

Provides the command `browser-test-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.0.2 |
| Published | 2020-04-19 |
| First published | 2019-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | Robert Corponoi |
| Maintainers | robertcorponoi |
| Keywords | browser, test, mocha, testing, chai |

## Links

- npm: https://www.npmjs.com/package/browser-test-mocha
- npm.io page: https://npm.io/package/browser-test-mocha

## Dependencies (6)

- [jsdom](https://npm.io/package/jsdom.md) ^16.2.2
- [fastify](https://npm.io/package/fastify.md) ^2.13.1
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [commander](https://npm.io/package/commander.md) ^5.0.0
- [fastify-static](https://npm.io/package/fastify-static.md) ^2.6.0

## 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
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-04-19
- 1.0.1 — 2020-01-01
- 1.0.0 — 2020-01-01
- 0.1.0 — 2019-08-28

## README

<p align="center">
  <img width="250" height="160" src="https://github.com/robertcorponoi/graphics/blob/master/browser-test-mocha/browser-test-mocha-logo.png?raw=true">
</p>

<h1 align="center">browser-test-mocha</h1>

<p align="center">browser-test-mocha sets up a test server using Mocha and Chai to test against a browser environment. You can use any mocha, chai, and sinon functionalitiy in your tests.<p>

<div align="center">

  [![NPM version](https://img.shields.io/npm/v/browser-test-mocha.svg?style=flat)](https://www.npmjs.com/package/browser-test-mocha)
  [![Known Vulnerabilities](https://snyk.io/test/github/robertcorponoi/browser-test-mocha/badge.svg)](https://snyk.io/test/github/robertcorponoi/browser-test-mocha)
  ![npm](https://img.shields.io/npm/dt/browser-test-mocha)
  [![NPM downloads](https://img.shields.io/npm/dm/browser-test-mocha.svg?style=flat)](https://www.npmjs.com/package/browser-test-mocha)
  <a href="https://badge.fury.io/js/browser-test-mocha"><img src="https://img.shields.io/github/issues/robertcorponoi/browser-test-mocha.svg" alt="issues" height="18"></a>
  <a href="https://badge.fury.io/js/browser-test-mocha"><img src="https://img.shields.io/github/license/robertcorponoi/browser-test-mocha.svg" alt="license" height="18"></a>
  [![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/robertcorponoi)

</div>

## **Install**

To install it as a global command to use anywhere you can use:

```shell
$ npm install -g browser-test-mocha
```

Otherwise, if you just want to use it programmatically inside of a project, you can install it at a project level:

```shell
$ npm install --save-dev browser-test-mocha
```

## **Usage**

To use browser-test-mocha, you need to pass the files containing the tests to it:

```shell
$ browser-test-mocha test/one.js,test/two.js,test/three.js
```

Note: multiple files can be passed separated by commas and no spaces in between.

After it has finished doing the necessary file operations, a http server will start up at nearest available port to 3000 and if you navigate to it in a browser, you will see the results of your tests.

## **Flags**

The current flags available for browser-test-mocha are:

```
browser-test-mocha <files> [options] 

-V, --version       Outputs the current version of browser-test-mocha
```

## **Tests**

To run the tests available for browser-test-mocha, use:

```bash
$ npm run test
```

## **License**

MIT

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