Created
April 20, 2021 13:03
-
-
Save guliash/e3490b41756ae32a8a04ce2cef25cbc6 to your computer and use it in GitHub Desktop.
Nock test fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('Profile endpoint 500. 500', async () => { | |
after(() => { | |
nock.cleanAll(); | |
}); | |
const agent = request.agent(app); | |
nock('https://oauth2.googleapis.com') | |
.post('/token') | |
.reply(200, { access_token: 'access_token' }) | |
nock('https://openidconnect.googleapis.com') | |
.get('/v1/userinfo') | |
.matchHeader('Authorization', 'Bearer access_token') | |
.reply(500); | |
const response = await agent.post('/api/user/login/google') | |
.send({ authCode: 'code' }); | |
assert.strictEqual(response.status, 500); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment