Skip to content

Commit

Permalink
Add next with sinon
Browse files Browse the repository at this point in the history
  • Loading branch information
ollita7 committed Jul 16, 2019
1 parent 1234ee7 commit 596612b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/middlewares.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { suite, test } from "mocha-typescript";
import { assert } from 'chai';
import { CorsMiddleware } from '../src/middlewares/corsMiddlware';
var httpMocks = require('node-mocks-http');
var sinon = require('sinon');

var next = sinon.spy();

@suite class MIddlewaresSuite {
static before() {
Expand Down Expand Up @@ -39,8 +41,8 @@ var httpMocks = require('node-mocks-http');
response.getHeaders = function () {
return {};
};
corsMiddleware.execute(request, response, null);
//assert.equal(response.statusCode, 200);
corsMiddleware.execute(request, response, next);
assert.isTrue(next.calledOnce);
}


Expand Down

0 comments on commit 596612b

Please sign in to comment.