Skip to content

Commit

Permalink
fixup!: apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jannyHou committed May 14, 2019
1 parent d7e7f56 commit 2ff383b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ describe('AuthenticateActionProvider', () => {
expect(user).to.be.equal(mockUser);
});

// This PoC is in progress, will recover the test asap
it.skip('throws an error if the injected passport strategy is not valid', async () => {
it('throws an error if the injected strategy is not valid', async () => {
const context: Context = new Context();
context
.bind(AuthenticationBindings.STRATEGY)
Expand All @@ -84,7 +83,10 @@ describe('AuthenticateActionProvider', () => {
} catch (exception) {
error = exception;
}
expect(error).to.have.property('message', 'invalid strategy parameter');
expect(error).to.have.property(
'message',
'strategy.authenticate is not a function',
);
});

it('throws Unauthorized error when authentication fails', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ describe('Strategy Adapter', () => {
// override authenticate method to set calledFlag
async authenticate(req: Request, options?: AuthenticateOptions) {
calledFlag = true;
await MockPassportStrategy.prototype.authenticate.call(
this,
req,
options,
);
await super.authenticate.call(this, req, options);
}
}
const strategy = new Strategy();
Expand Down

0 comments on commit 2ff383b

Please sign in to comment.