Skip to content

Commit

Permalink
Update test with async support
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Nov 7, 2023
1 parent b42aa01 commit 854c93a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/passport/passport_strategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('OpenIDConnectStrategy', () => {
});
});

describe('initate', function () {
describe('initiate', function () {
it('starts authentication requests for GETs', async function () {
const params = { foo: 'bar' };
const strategy = new Strategy({ client: this.client, params }, () => {});
Expand All @@ -128,15 +128,15 @@ describe('OpenIDConnectStrategy', () => {
);
});

it('starts authentication requests for TPIL GETs', function () {
it('starts authentication requests for TPIL GETs', async function () {
const params = { iss: 'https://op.example.com' };
const strategy = new Strategy({ client: this.client, params }, () => {});

const req = new MockRequest('GET', '/login/oidc');
req.session = {};

strategy.redirect = sinon.spy();
strategy.authenticate(req);
await strategy.authenticate(req);

expect(strategy.redirect.calledOnce).to.be.true;
const target = strategy.redirect.firstCall.args[0];
Expand Down

0 comments on commit 854c93a

Please sign in to comment.