Skip to content

Commit

Permalink
Upgrade mocha to 5.2.0, refactor tests descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
weyoss committed Jan 20, 2019
1 parent 417b75e commit 9c76d00
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"eslint-plugin-import": "2.2.0",
"eslint-plugin-promise": "3.4.1",
"eslint-plugin-standard": "2.0.1",
"mocha": "3.2.0",
"mocha": "5.2.0",
"sinon": "1.17.7",
"sinon-chai": "2.11.0"
},
Expand Down
6 changes: 6 additions & 0 deletions test/run/hooks.js
Expand Up @@ -37,6 +37,12 @@ before(function (done) {
done();
});

after(function (done) {
this.sandbox.producer.shutdown();
client.end(true);
done();
});

beforeEach(function (done) {
this.sandbox.restore();
this.sandbox.getConsumer = getConsumer;
Expand Down
2 changes: 1 addition & 1 deletion test/run/test01.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 1: A consumer does not a consume a message when no messages are produced', function() {
describe('Test 1: A consumer is idle given no messages are produced', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test04.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 4: A message produced with TTL is not consumed and get destroyed when TTL exceeds', function() {
describe('Test 4: Produce a message having messageTTL, and sure the message is not consumed and destroyed when messageTTL exceeds', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test05.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 5: A consumer with message TTL does not consume a message being in the queue for longer than TTL', function() {
describe('Test 5: Construct a consumer with messageTTL parameter and make sure it does not consume a message when messageTTL is exceeded', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test06.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 6: A consumer does time out after consume timeout exceeds and requeue the message to be consumed again', function() {
describe('Test 6: When consuming a mesage, a consumer does time out after messageConsumeTimeout exceeds and re-queues the message to be consumed again', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test07.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 7: A consumer re-queues and consumes again failed message when threshold not reached', function() {
describe('Test 7: A consumer re-queues and consumes again a failed message when threshold not exceeded', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test09.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 9: A consumer re-queues a failed message when threshold not reached and moves it to dead queue when threshold reached', function() {
describe('Test 9: A consumer re-queues a failed message when threshold is not exceeded, otherwise it moves the message to DLQ (dead letter queue)', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test13.js
Expand Up @@ -8,7 +8,7 @@ const Message = require('../../index').Message;
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 13: Produce and consume a delayed message with repeat and period', function() {
describe('Test 13: Produce and consume a delayed message with scheduledRepeat and scheduledPeriod parameters', function() {

it('Case 1: is OK', function (done) {
this.timeout(60000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test14.js
Expand Up @@ -8,7 +8,7 @@ const Message = require('../../index').Message;
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 14: Produce and consume a delayed message with CRON and repeat and period', function() {
describe('Test 14: Produce and consume a delayed message with scheduledCRON/scheduledRepeat/scheduledPeriod parameters', function() {

it('Case 1: is OK', function (done) {
this.timeout(60000);
Expand Down
2 changes: 1 addition & 1 deletion test/run/test15.js
Expand Up @@ -7,7 +7,7 @@ const sinonChai = require('sinon-chai');
const expect = chai.expect;
chai.use(sinonChai);

describe('Test 15: A consumer waits for rety delay before consuming again a failed message when threshold not reached', function() {
describe('Test 15: A consumer delays a failed message before re-queuing it again, given messageRetryThreshold is not exceeded', function() {

it('is OK', function (done) {
this.timeout(20000);
Expand Down

0 comments on commit 9c76d00

Please sign in to comment.