Skip to content

Commit

Permalink
Delint tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Nov 27, 2013
1 parent 360b05e commit 4098979
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 26 deletions.
2 changes: 2 additions & 0 deletions test/package.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, it, expect */

var oauth2orize = require('..');

describe('chai-oauth2orize-grant', function() {
Expand Down
2 changes: 2 additions & 0 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, it, expect */

var plugin = require('..')
, Test = require('../lib/test');

Expand Down
2 changes: 2 additions & 0 deletions test/request.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, it, expect */

var Request = require('../lib/request');

describe('Request', function() {
Expand Down
10 changes: 6 additions & 4 deletions test/response.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, it, before, expect */

var Response = require('../lib/response');

describe('Response', function() {
Expand Down Expand Up @@ -27,7 +29,7 @@ describe('Response', function() {
res = new Response(function() {
process.nextTick(done);
});
res.redirect('http://www.example.com/foo')
res.redirect('http://www.example.com/foo');
});

it('should get set status and location', function() {
Expand All @@ -43,7 +45,7 @@ describe('Response', function() {
res = new Response(function() {
process.nextTick(done);
});
res.redirect('http://www.example.com/foo', 303)
res.redirect('http://www.example.com/foo', 303);
});

it('should get set status and location', function() {
Expand All @@ -59,7 +61,7 @@ describe('Response', function() {
res = new Response(function() {
process.nextTick(done);
});
res.end()
res.end();
});

it('should get set status and not body', function() {
Expand All @@ -75,7 +77,7 @@ describe('Response', function() {
res = new Response(function() {
process.nextTick(done);
});
res.end('Hello')
res.end('Hello');
});

it('should get set status and body', function() {
Expand Down
6 changes: 4 additions & 2 deletions test/test.end.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that calls end', function() {

var grant = {};
grant.request = function(req) {}
grant.request = function(req) {};
grant.response = function(txn, res, next) {
res.end('Hello');
}
};

describe('with an end callback', function() {
var res;
Expand Down
14 changes: 8 additions & 6 deletions test/test.next.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that calls next', function() {

var grant = {};
grant.request = function(req) {}
grant.request = function(req) {};
grant.response = function(txn, res, next) {
next()
}
next();
};

describe('with a next callback', function() {
var err;
Expand Down Expand Up @@ -38,10 +40,10 @@ describe('test grant that calls next', function() {
describe('test grant that calls next with error', function() {

var grant = {};
grant.request = function(req) {}
grant.request = function(req) {};
grant.response = function(txn, res, next) {
next(new Error('oops'))
}
next(new Error('oops'));
};

describe('with a next callback', function() {
var err;
Expand Down
18 changes: 10 additions & 8 deletions test/test.parse.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that calls parse', function() {

var grant = {};
grant.request = function(req) {
return { foo: 'bar' };
}
grant.response = function(txn, res, next) {}
};
grant.response = function(txn, res, next) {};

describe('with a parse callback', function() {
var err, obj;
Expand Down Expand Up @@ -45,8 +47,8 @@ describe('test grant that calls async parse', function() {
var grant = {};
grant.request = function(req, done) {
return done(null, { foo: 'bar' });
}
grant.response = function(txn, res, next) {}
};
grant.response = function(txn, res, next) {};

describe('with a parse callback', function() {
var err, obj;
Expand Down Expand Up @@ -76,8 +78,8 @@ describe('test grant that calls parse that throws an exception', function() {
var grant = {};
grant.request = function(req, done) {
throw new Error('something was thrown');
}
grant.response = function(txn, res, next) {}
};
grant.response = function(txn, res, next) {};

describe('with a parse callback', function() {
var err, obj;
Expand All @@ -104,8 +106,8 @@ describe('test grant that calls async parse that encounters an error', function(
var grant = {};
grant.request = function(req, done) {
return done(new Error('something went wrong'));
}
grant.response = function(txn, res, next) {}
};
grant.response = function(txn, res, next) {};

describe('with a parse callback', function() {
var err, obj;
Expand Down
6 changes: 4 additions & 2 deletions test/test.req.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that prepares request', function() {

var grant = {};
grant.request = function(req) {
return { hello: req.query.hello };
}
grant.response = function(txn, res, next) {}
};
grant.response = function(txn, res, next) {};

describe('sync', function() {

Expand Down
6 changes: 4 additions & 2 deletions test/test.res.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that prepares response', function() {

var grant = {};
grant.request = function(req) {}
grant.request = function(req) {};
grant.response = function(txn, res, next) {
res.end();
}
};

describe('sync', function() {

Expand Down
6 changes: 4 additions & 2 deletions test/test.txn.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* global describe, it, before, expect */

var Test = require('../lib/test');

describe('test grant that prepares transaction', function() {

var grant = {};
grant.request = function(req) {}
grant.request = function(req) {};
grant.response = function(txn, res, next) {
res.end(txn.ext.hello);
}
};

describe('sync', function() {

Expand Down

0 comments on commit 4098979

Please sign in to comment.