Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiddentao/mocha-ci-slack-reporter
Slack reporter for Mocha when running in CI environments
https://github.com/hiddentao/mocha-ci-slack-reporter
Last synced: 8 days ago
JSON representation
Slack reporter for Mocha when running in CI environments
- Host: GitHub
- URL: https://github.com/hiddentao/mocha-ci-slack-reporter
- Owner: hiddentao
- License: mit
- Created: 2017-01-05T21:28:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-24T22:49:33.000Z (almost 8 years ago)
- Last Synced: 2024-10-22T20:11:47.797Z (17 days ago)
- Language: JavaScript
- Size: 138 KB
- Stars: 2
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# mocha-ci-slack-reporter
[![Build Status](https://secure.travis-ci.org/hiddentao/mocha-ci-slack-reporter.png)](http://travis-ci.org/hiddentao/mocha-ci-slack-reporter)
[![NPM module](https://badge.fury.io/js/mocha-ci-slack-reporter.png)](https://badge.fury.io/js/mocha-ci-slack-reporter)
[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao)Slack reporter for Mocha when running in CI environments.
Although this can be used in non-CI environments too, it is suited for CI
environment in that it is able to report build number, build URL, etc alongside
standard test pass/failed information.It posts a single pretty notification to your Slack channel with a summary of
the test failures and/or successful run.What it looks like:
![Slack screenshot](screenshot.png)
## Installation
```shell
$ npm install mocha-ci-slack-reporter
```## Usage
All options:
* `testTitle` - (mandatory) Title of test in report
* `url` (mandatory) - Slack incoming webhook URL
* `username` (mandatory) - Username to post as
* `channel` (mandatory) - Channel to post to
* `logsUrl` - URL to logs page, appended to message text (default is undefined)
* `passEmoji` - Emoji to use for test pass (default is :ok_hand:)
* `failEmoji` - Emoji to use for test failure (default is :bomb:)
* `failuresOnly` - Whether to only report failures (default is `false`)### via Command-line
```shell
$ mocha test --reporter mocha-ci-slack-reporter --reporter-options username=name,channel=#channel_name,...
```### via API
```javascript
var mocha = new Mocha({
reporter: 'mocha-ci-slack-reporter',
reporterOptions: {
testTitle: 'My tests',
url: 'https://hooks.slack.com/...',
username: 'reporter',
channel: '#mychannel',
logsUrl: 'https://ci.com/project/...'
}
});
```## License
MIT - see [LICENSE.md](LICENSE.md)