Skip to content

Commit

Permalink
update docs and specs
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Sep 6, 2016
1 parent 55151e7 commit e883a2f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 34 deletions.
3 changes: 1 addition & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = function (grunt) {
reporter: 'spec',
timeout: 20000
},
// src: ['test/**/*.js']
src: ['test/schedule/schedule.spec.js']
src: ['test/**/*.js']
}
},
jshint: {
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kue-scheduler(Unstable)
# kue-scheduler

[![Build Status](https://travis-ci.org/lykmapipo/kue-scheduler.svg?branch=master)](https://travis-ci.org/lykmapipo/kue-scheduler)
[![Dependency Status](https://img.shields.io/david/lykmapipo/kue-scheduler.svg?style=flat)](https://david-dm.org/lykmapipo/kue-scheduler)
Expand All @@ -10,6 +10,8 @@ Scheduling API is heavily inspired and borrowed from [agenda](https://github.com

*Note!: expiry key notification are now enabled by default, if provided kue options has a permission to do so unless explicit disabled by passing `skipConfig` option when creating `kue` instance*

*Note!: kue-scheduler v0.6.0 is a refactored version of previous kue-scheduler to allow redis data structure and schedule queue best practice. API is the same but some of internal working may not work as previous ones*

## Requirements
- Redis 2.8.0 or higher.

Expand Down
4 changes: 3 additions & 1 deletion test/capability.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ describe('Queue Scheduling Capabilities', function () {
});

after(function (done) {
Queue.shutdown(done);
Queue.clear(function ( /*error,results*/ ) {
Queue.shutdown(done);
});
});


Expand Down
6 changes: 4 additions & 2 deletions test/instatiation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ var Queue;
describe('Queue Job Scheduler & Listener', function () {

afterEach(function (done) {
Queue.shutdown(done);
Queue = null;
Queue.clear(function ( /*error,results*/ ) {
Queue.shutdown(done);
Queue = null;
});
});

it('should be able to instantiate kue-scheduler with custom options',
Expand Down
4 changes: 3 additions & 1 deletion test/job_builder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('Queue JobBuilder', function () {
});

after(function (done) {
Queue.shutdown(done);
Queue.clear(function ( /*error,results*/ ) {
Queue.shutdown(done);
});
});


Expand Down
29 changes: 3 additions & 26 deletions test/non_default_db.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,9 @@ var _ = require('lodash');
var path = require('path');
var kue = require(path.join(__dirname, '..', 'index'));
var faker = require('faker');
var async = require('async');
var Queue;
var redisPublishClient;

//TODO: Clean up the cleanup.

//redis client for database cleanups
var redisCleanUpClient = kue.redis.createClientFactory({
redis: {
db: 2
}
});

function cleanup(callback) {
redisCleanUpClient
.keys('q*', function (error, rows) {
if (error) {
callback(error);
} else {
async.each(rows, function (row, next) {
redisCleanUpClient.del(row, next);
}, callback);
}
});
}

describe('Queue non-default database', function () {

beforeEach(function (done) {
Expand All @@ -44,9 +21,9 @@ describe('Queue non-default database', function () {
done();
});

afterEach(function (done) {
Queue.shutdown(function () {
cleanup(done);
after(function (done) {
Queue.clear(function ( /*error,results*/ ) {
Queue.shutdown(done);
});
});

Expand Down
4 changes: 3 additions & 1 deletion test/schedule/messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ describe('Queue#redis messages', function () {
});

after(function (done) {
Queue.shutdown(done);
Queue.clear(function ( /*error,results*/ ) {
Queue.shutdown(done);
});
});

it('should be able to filter unrelated redis published messages',
Expand Down

0 comments on commit e883a2f

Please sign in to comment.