Skip to content

Commit

Permalink
fix: refreshToken test should mock well known before each test
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongranick-okta committed Feb 14, 2020
1 parent 792e408 commit 05d4f30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/okta-auth-js/karma.conf.js
Expand Up @@ -65,6 +65,10 @@ module.exports = function (config) {
stats: 'normal',
},
client: {
jasmine: {
random: true, // Default: true. Tests should have no effect on other tests
timeoutInterval: 5000 // Default: 5000. Can increase locally when debugging
},
// Passing specific test to run
// but this works only with `karma start`, not `karma run`.
test: config.test,
Expand All @@ -81,6 +85,7 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadlessNoSandbox'],
concurrency: 1,
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
Expand Down
3 changes: 1 addition & 2 deletions packages/okta-auth-js/test/karma/spec/renewToken.js
Expand Up @@ -50,6 +50,7 @@ describe('Renew token', function() {
config = Object.assign({}, DEFAULT_CONFIG, config);
sdk = new OktaAuth(config);
sdk.tokenManager.clear();
mockWellKnown();
return Promise.resolve();
}

Expand Down Expand Up @@ -217,8 +218,6 @@ describe('Renew token', function() {
})
.then(() => {
sdk.tokenManager.add('accessToken', ACCCESS_TOKEN_PARSED);

mockWellKnown();

spyOn(oauthUtil, 'generateNonce').and.returnValue(NONCE);

Expand Down

0 comments on commit 05d4f30

Please sign in to comment.