Skip to content

Commit 86b0df9

Browse files
committed
Merge branch 'release/1.0.9'
2 parents 7cf6c81 + 41d3578 commit 86b0df9

15 files changed

+1881
-2789
lines changed

.circleci/config.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
- restore_cache:
2020
keys:
2121
- v1-dependencies-{{ checksum "package.json" }}
22-
# fallback to using the latest cache if no exact match is found
23-
- v1-dependencies-
2422

2523
- run:
2624
name: Install global packages
@@ -47,6 +45,11 @@ jobs:
4745
name: Unit Tests with Code Coverage
4846
command: npm run test:unit:cov
4947

48+
# Far too flakey to run on CI
49+
# - run:
50+
# name: Mutation Tests
51+
# command: npm run test:mutants
52+
5053
- run:
5154
name: Integration Tests
5255
command: npm run test:integration

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['standard', 'prettier', 'prettier/standard'],
3-
plugins: ['prettier', 'standard', 'mocha'],
3+
plugins: ['prettier', 'standard', 'import', 'promise'],
44
parserOptions: {
55
sourceType: 'module'
66
},

README.md

+24-22
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,34 @@
11
# AMQP Simple Pub Sub
22

3-
[![Greenkeeper badge](https://badges.greenkeeper.io/davesag/amqp-simple-pub-sub.svg)](https://greenkeeper.io/)
4-
5-
A simple Pub Sub system that uses AMQP Messaging to exchange data between services
6-
7-
<!-- prettier-ignore -->
8-
| Branch | Tests | Code Coverage | Comments |
9-
| ------ | ----- | ------------- | -------- |
10-
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/develop) | [![codecov](https://codecov.io/gh/davesag/amqp-simple-pub-sub/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-simple-pub-sub) | Work in progress |
11-
| `master` | [![CircleCI](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/master) | [![codecov](https://codecov.io/gh/davesag/amqp-simple-pub-sub/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-simple-pub-sub) | Latest release |
3+
A Pub Sub system that uses `AMQP` messaging to exchange data between services.
124

135
[![NPM](https://nodei.co/npm/amqp-simple-pub-sub.png)](https://nodei.co/npm/amqp-simple-pub-sub/)
146

157
## To Use
168

179
You project needs to be using at least Node version 8, and ideally Node 10 (LTS) or later.
1810

19-
```
11+
```sh
2012
npm install amqp-simple-pub-sub
2113
```
2214

2315
### Create a Publisher
2416

25-
```
17+
```js
2618
const { makePublisher } = require('amqp-simple-pub-sub')
2719
const publisher = makePublisher({ exchange: 'testService' })
2820
```
2921

3022
### Publish a message
3123

32-
```
24+
```js
3325
await publisher.start()
3426
publisher.publish('test', 'Hello World')
3527
```
3628

3729
### Create a Subscriber
3830

39-
```
31+
```js
4032
const { makeSubscriber } = require('amqp-simple-pub-sub')
4133

4234
const subscriber = makeSubscriber({
@@ -48,7 +40,7 @@ const subscriber = makeSubscriber({
4840

4941
### Subscribe to a queue and listen for messages
5042

51-
```
43+
```js
5244
const handler = message => {
5345
console.log('Message Received', message)
5446
subscriber.ack(message)
@@ -63,7 +55,7 @@ subscriber.start(handler)
6355

6456
The full options object is as follows
6557

66-
```
58+
```js
6759
{
6860
type: 'topic', // the default
6961
url: 'amqp://localhost', // the default
@@ -81,7 +73,7 @@ The full options object is as follows
8173

8274
The full options object is as follows
8375

84-
```
76+
```js
8577
{
8678
type: 'topic', // the default
8779
url: 'amqp://localhost', // the default
@@ -111,33 +103,43 @@ See some examples in the tests, and also:
111103

112104
## Development
113105

106+
[![Greenkeeper badge](https://badges.greenkeeper.io/davesag/amqp-simple-pub-sub.svg)](https://greenkeeper.io/)
107+
108+
<!-- prettier-ignore -->
109+
| Branch | Tests | Code Coverage | Comments |
110+
| ------ | ----- | ------------- | -------- |
111+
| `develop` | [![CircleCI](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/develop.svg?style=svg)](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/develop) | [![codecov](https://codecov.io/gh/davesag/amqp-simple-pub-sub/branch/develop/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-simple-pub-sub) | Work in progress |
112+
| `master` | [![CircleCI](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/master.svg?style=svg)](https://circleci.com/gh/davesag/amqp-simple-pub-sub/tree/master) | [![codecov](https://codecov.io/gh/davesag/amqp-simple-pub-sub/branch/master/graph/badge.svg)](https://codecov.io/gh/davesag/amqp-simple-pub-sub) | Latest release |
113+
114114
### Prerequisites
115115

116-
- [NodeJS](htps://nodejs.org), version 10.15.3 (LTS) or better (I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.)
116+
- [NodeJS](htps://nodejs.org), version 10.16.1 (LTS) or better (I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.)
117117
- [Docker](https://www.docker.com) (Use [Docker for Mac](https://docs.docker.com/docker-for-mac/), not the homebrew version)
118118

119119
### Initialisation
120120

121-
```
121+
```sh
122122
npm install
123123
```
124124

125125
### To Start the queue server for integration testing.
126126

127-
```
127+
```sh
128128
docker-compose up -d
129129
```
130130

131131
Runs Rabbit MQ.
132132

133133
### Test it
134134

135-
- `npm test` — runs the unit tests (quick and does not need rabbit mq running)
136-
- `npm run test:integration` — runs the integration tests (not so quick and needs rabbitmq running)
135+
- `npm test` — runs the unit tests (quick and does not need `rabbitmq` running)
136+
- `npm run test:unit:cov` — runs the unit tests with code coverage (does not need `rabbitmq`)
137+
- `npm run test:integration` — runs the integration tests (needs `rabbitmq`)
138+
- `npm run test:mutants` — runs the mutation tests (does not need `rabbitmq`)
137139

138140
### Lint it
139141

140-
```
142+
```sh
141143
npm run lint
142144
```
143145

0 commit comments

Comments
 (0)