Skip to content

Commit

Permalink
tests: remove empty options from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jan 26, 2018
1 parent ed253ab commit bd77108
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,7 @@

it('origin defaults to *', function (done) {
// arrange
var req, res, next, options;
options = {
};
var req, res, next;
req = fakeRequest('GET');
res = fakeResponse();
next = function () {
Expand All @@ -358,7 +356,7 @@
};

// act
cors(options)(req, res, next);
cors()(req, res, next);
});

it('specifying true for origin reflects requesting origin', function (done) {
Expand Down Expand Up @@ -479,9 +477,7 @@

it('methods defaults to GET, PUT, PATCH, POST, DELETE', function (done) {
// arrange
var req, res, next, options;
options = {
};
var req, res, next;
req = fakeRequest('OPTIONS');
res = fakeResponse();
res.end = function () {
Expand All @@ -496,7 +492,7 @@
};

// act
cors(options)(req, res, next);
cors()(req, res, next);
});

it('can specify allowed headers as array', function (done) {
Expand Down Expand Up @@ -558,9 +554,7 @@

it('if no allowed headers are specified, defaults to requested allowed headers', function (done) {
// arrange
var req, res, options;
options = {
};
var req, res;
req = fakeRequest('OPTIONS');
res = fakeResponse();
res.end = function () {
Expand All @@ -571,7 +565,7 @@
};

// act
cors(options)(req, res, null);
cors()(req, res, null);
});

it('can specify exposed headers as array', function (done) {
Expand Down Expand Up @@ -648,9 +642,7 @@

it('does not includes credentials unless explicitly enabled', function (done) {
// arrange
var req, res, next, options;
options = {
};
var req, res, next;
req = fakeRequest('GET');
res = fakeResponse();
next = function () {
Expand All @@ -660,7 +652,7 @@
};

// act
cors(options)(req, res, next);
cors()(req, res, next);
});

it('includes maxAge when specified', function (done) {
Expand All @@ -683,9 +675,7 @@

it('does not includes maxAge unless specified', function (done) {
// arrange
var req, res, next, options;
options = {
};
var req, res, next;
req = fakeRequest('GET');
res = fakeResponse();
next = function () {
Expand All @@ -695,7 +685,7 @@
};

// act
cors(options)(req, res, next);
cors()(req, res, next);
});
});

Expand Down

0 comments on commit bd77108

Please sign in to comment.