Skip to content

Commit

Permalink
Create mocha-ur2ue root hook plugin module
Browse files Browse the repository at this point in the history
Based on my node-project-template.
To work around mochajs/mocha#1926 and mochajs/mocha#2640.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information
kevinoid committed Jun 13, 2020
1 parent 38fae2c commit 1e7c830
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 381 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Expand Up @@ -23,10 +23,4 @@ install:
- npm install

script:
- npm run test-cov

# Note: Both codecov and coveralls detect branch/PR info from Travis CI
# https://github.com/codecov/codecov-node/blob/v1.0.1/lib/services/travis.js
# https://github.com/nickmerwin/node-coveralls/blob/2.11.5/lib/getOptions.js#L18
after_success:
- npm run upload-cov
- npm run test
65 changes: 24 additions & 41 deletions README.md
@@ -1,53 +1,40 @@
Project Template
================

[![Build Status: Linux](https://img.shields.io/travis/kevinoid/project-template/master.svg?style=flat&label=build+on+linux)](https://travis-ci.org/kevinoid/project-template)
[![Build Status: Windows](https://img.shields.io/appveyor/ci/kevinoid/project-template/master.svg?style=flat&label=build+on+windows)](https://ci.appveyor.com/project/kevinoid/project-template)
[![Coverage](https://img.shields.io/codecov/c/github/kevinoid/project-template.svg?style=flat)](https://codecov.io/github/kevinoid/project-template?branch=master)
[![Dependency Status](https://img.shields.io/david/kevinoid/project-template.svg?style=flat)](https://david-dm.org/kevinoid/project-template)
[![Supported Node Version](https://img.shields.io/node/v/@kevinoid/project-template.svg?style=flat)](https://www.npmjs.com/package/@kevinoid/project-template)
[![Version on NPM](https://img.shields.io/npm/v/@kevinoid/project-template.svg?style=flat)](https://www.npmjs.com/package/@kevinoid/project-template)

A Node.js/npm project template with [codecov](https://codecov.io/),
[coveralls](https://coveralls.io/), [ESLint](https://eslint.org/),
[conventional-changelog](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli),
[nyc](https://github.com/istanbuljs/nyc), [JSDoc](http://usejsdoc.org/), and
[mocha](https://mochajs.org/).

It is the template that I am using for my own Node.js projects, which
represents my current preferences. I am not advocating for these choices nor
this template specifically, although I am happy to discuss or explain any
choices made herein. It is being published both for my own convenience and
in case it may be useful to others with similar tastes.
mocha-ur2ue
===========

[![Build Status: Linux](https://img.shields.io/travis/kevinoid/mocha-ur2ue/master.svg?style=flat&label=build+on+linux)](https://travis-ci.org/kevinoid/mocha-ur2ue)
[![Build Status: Windows](https://img.shields.io/appveyor/ci/kevinoid/mocha-ur2ue/master.svg?style=flat&label=build+on+windows)](https://ci.appveyor.com/project/kevinoid/mocha-ur2ue)
[![Coverage](https://img.shields.io/codecov/c/github/kevinoid/mocha-ur2ue.svg?style=flat)](https://codecov.io/github/kevinoid/mocha-ur2ue?branch=master)
[![Dependency Status](https://img.shields.io/david/kevinoid/mocha-ur2ue.svg?style=flat)](https://david-dm.org/kevinoid/mocha-ur2ue)
[![Supported Node Version](https://img.shields.io/node/v/mocha-ur2ue.svg?style=flat)](https://www.npmjs.com/package/mocha-ur2ue)
[![Version on NPM](https://img.shields.io/npm/v/mocha-ur2ue.svg?style=flat)](https://www.npmjs.com/package/mocha-ur2ue)

A [Mocha](https://mochajs.org/) [root hook
plugin](https://mochajs.org/#root-hook-plugins) to convert
[`unhandledrejection`
events](https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event)
to unhandled exceptions so that they will cause test failures. This works
around a long-standing issue
([mochajs/mocha#1926](https://github.com/mochajs/mocha/issues/1926) and
[mochajs/mocha#2640](https://github.com/mochajs/mocha/issues/2640)) that
unhandled rejections do not cause test failure in Mocha.

## Introductory Example

```js
```sh
npm install --save-dev mocha mocha-ur2ue
mocha --require mocha-ur2ue --recursive tests
```

## Features


## Installation

[This package](https://www.npmjs.com/package/@kevinoid/project-template) can be
[This package](https://www.npmjs.com/package/mocha-ur2ue) can be
installed using [npm](https://www.npmjs.com/), either globally or locally, by
running:

```sh
npm install @kevinoid/project-template
npm install mocha-ur2ue
```

## Recipes

More examples can be found in the [test
specifications](https://kevinoid.github.io/project-template/spec).

## API Docs

To use this module as a library, see the [API
Documentation](https://kevinoid.github.io/project-template/api).

## Contributing

Contributions are appreciated. Contributors agree to abide by the [Contributor
Expand All @@ -67,7 +54,3 @@ save a lot of time and effort.

This project is available under the terms of the [MIT License](LICENSE.txt).
See the [summary at TLDRLegal](https://tldrlegal.com/license/mit-license).

The [template](https://github.com/kevinoid/node-project-template) upon which
this project is based is available under the terms of
[CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/).
139 changes: 0 additions & 139 deletions bin/cmd.js

This file was deleted.

45 changes: 0 additions & 45 deletions doc-src/spec/footer.xhtml

This file was deleted.

24 changes: 0 additions & 24 deletions doc-src/spec/header.xhtml

This file was deleted.

39 changes: 0 additions & 39 deletions index.js

This file was deleted.

23 changes: 0 additions & 23 deletions jsdoc-lint.conf.json

This file was deleted.

25 changes: 0 additions & 25 deletions jsdoc.conf.json

This file was deleted.

0 comments on commit 1e7c830

Please sign in to comment.