# grunt-simple-mocha

> A simple wrapper for running tests with Mocha.

Latest version **0.4.1** (published 2015-12-30) · 0 weekly downloads

## Install

```sh
npm install grunt-simple-mocha
pnpm add grunt-simple-mocha
yarn add grunt-simple-mocha
bun add grunt-simple-mocha
```

Provides the command `grunt-simple-mocha`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2015-12-30 |
| First published | 2012-09-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 108 |
| Author | Mukund Lakshman |
| Maintainers | yaymukund |
| Keywords | gruntplugin, mocha, test |

## Links

- npm: https://www.npmjs.com/package/grunt-simple-mocha
- Repository: https://github.com/yaymukund/grunt-simple-mocha
- Issues: https://github.com/yaymukund/grunt-simple-mocha/issues
- npm.io page: https://npm.io/package/grunt-simple-mocha

## Dependencies (1)

- [mocha](https://npm.io/package/mocha.md) *

## 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

- 0.4.1 (latest) — 2015-12-30
- 0.4.0 — 2013-04-09
- 0.3.2 — 2013-01-14
- 0.3.1 — 2012-12-16
- 0.3.0 — 2012-12-16
- 0.2.0 — 2012-09-24
- 0.1.2 — 2012-09-05
- 0.1.1 — 2012-09-02
- 0.1.0 — 2012-09-02

## README

# grunt-simple-mocha

A simple wrapper for running tests with Mocha. It's pretty much a cleaned up
and plugin-ized version of [this helpful Gist by johnkpaul][johnkpaul_gist].

If you're looking to run client-side specs with PhantomJS, you might be
interested in [grunt-mocha][othermocha].

### Updating from 0.2.x to 0.3.x

This task now depends on grunt 0.4.x. Please see the
[grunt 0.3 to 0.4 migration guide][migration_guide] for more details.

## Installation
1. Install this grunt plugin next to your project's
   [Gruntfile.js][getting_started] with:
   ```javascript
   npm install grunt-simple-mocha --save-dev
   ```

2. Then add this line to your project's `grunt.js` gruntfile:
   ```javascript
   grunt.loadNpmTasks('grunt-simple-mocha');
   ```

## Usage

In your grunt.js:

```javascript
grunt.initConfig({
  simplemocha: {
    //
    // These are passed directly to the mocha constructor. See:
    //   https://github.com/mochajs/mocha/blob/master/lib/mocha.js#L56-L74
    //
    options: {
      ui: 'bdd',
      reporter: 'tap',
      globals: ['window','document','$','should'],
      timeout: 3000,
      retries: 2,
      bail: false,
      slow: 2000,
      ignoreLeaks: false,
      fullTrace: true
      grep: 'users',
    },

    all: { src: ['test/**/*.js'] }
  }
});

// For this to work, you need to have run `npm install grunt-simple-mocha`
grunt.loadNpmTasks('grunt-simple-mocha');

// Add a default task. This is optional, of course :)
grunt.registerTask('default', 'simplemocha');
```

Now, you can just run `grunt simplemocha` in your shell to run the tests. That's it!

## Running tests

Run `npm install && npm test`

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality. Lint and test your
code using [grunt][grunt_github].

## Migration Guides

### Updating from 0.2.x to 0.3.x

This task now depends on grunt 0.4.x. Please see the
[grunt 0.3 to 0.4 migration guide][migration_guide] for more details.

### Updating from 0.1.x to 0.2.x

If you were using 0.1.x, the task name has changed from `mocha` to
`simplemocha` to avoid confusion with [grunt-mocha][othermocha]. Please make
sure your grunt.js file is updated. See [#3][issue3].  

## Release History

* v0.1 - Woo!
* v0.2 - Changed the task name from `mocha` to `simplemocha`. See [#3][issue3].
* v0.3 - Updated to support grunt 0.4.x.
* v0.4 - Updated to support node 0.10.x.
* v0.4.1 - Updated readme and added tests.

## License
Copyright (c) 2012 Mukund Lakshman

Licensed under the MIT license.

[getting_started]: https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
[johnkpaul_gist]: https://gist.github.com/2361303
[grunt_github]: http://github.com/cowboy/grunt
[issue3]: https://github.com/yaymukund/grunt-simple-mocha/issues/3
[othermocha]: https://github.com/kmiyashiro/grunt-mocha
[migration_guide]: https://github.com/gruntjs/grunt/wiki/Upgrading-from-0.3-to-0.4

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