Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
StopRefresh once test is done.
  • Loading branch information
sthangavel committed Oct 21, 2019
commit f5ca941892f4658545ed7763e854f50e48a90cb0
8 changes: 8 additions & 0 deletions test/OAuthClientTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ describe('Tests for AutoRefresh', () => {
expect(authResponse.getToken().access_token)
.to.be.equal(expectedAccessToken.access_token);
expect(oauthClientWithAutoRefresh.autoRefreshHandle).to.not.equal(undefined);
oauthClientWithAutoRefresh.stopAutoRefresh();
});

oauthClientWithAutoRefreshAndInterval.createToken(parseRedirect)
.then((authResponse) => {
expect(authResponse.getToken().access_token)
.to.be.equal(expectedAccessToken.access_token);
expect(oauthClientWithAutoRefreshAndInterval.autoRefreshHandle).to.not.equal(undefined);
oauthClientWithAutoRefreshAndInterval.stopAutoRefresh();
});
});
});
Expand Down Expand Up @@ -154,6 +156,8 @@ describe('Tests for AutoRefresh', () => {
// Advance clock again (55 minutes)
this.clock.tick(55 * 60 * 1000);
expect(refreshCallSpy.calledTwice).to.be.true;

oauthClientWithAutoRefresh.stopAutoRefresh();
});
});
});
Expand Down Expand Up @@ -199,6 +203,8 @@ describe('Tests for AutoRefresh', () => {
// Advance clock again (3 seconds)
this.clock.tick(3 * 1000);
expect(refreshCallSpy.calledTwice).to.be.true;

oauthClientWithAutoRefreshAndInterval.stopAutoRefresh();
});
});
});
Expand Down Expand Up @@ -251,6 +257,8 @@ describe('Tests for AutoRefresh', () => {
// Advance clock again (55 minutes)
this.clock.tick(55 * 60 * 1000);
expect(refreshCallSpy.calledOnce).to.not.be.true;

oauthClientWithAutoRefresh.stopAutoRefresh();
});
});
});
Expand Down