Skip to content

Commit 20d7bc9

Browse files
authored
Merge pull request #20351 from mozilla/fix-flaky-auth-token-unit-test
test(auth): Mock oauth/token module in token exchange unit test
2 parents b628af4 + 5cb192d commit 20d7bc9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/fxa-auth-server/lib/routes/oauth/token.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,9 @@ describe('/oauth/token POST', () => {
745745
jest.doMock('../utils/oauth', () => ({
746746
newTokenNotification: newTokenNotificationStub,
747747
}));
748+
jest.doMock('../../oauth/token', () => ({
749+
verify: sinon.stub().resolves({ user: UID }),
750+
}));
748751
const routes = require('./token')({
749752
...tokenRoutesArgMocks,
750753
db: {
@@ -828,6 +831,9 @@ describe('/oauth/token POST', () => {
828831
jest.doMock('../utils/oauth', () => ({
829832
newTokenNotification: newTokenNotificationStub,
830833
}));
834+
jest.doMock('../../oauth/token', () => ({
835+
verify: sinon.stub().resolves({ user: UID }),
836+
}));
831837
const routes = require('./token')({
832838
...tokenRoutesArgMocks,
833839
db: {

0 commit comments

Comments
 (0)