Skip to content

Commit 1df26c8

Browse files
authored
test: Remove set timeouts from tests and other cleanup (#998)
1 parent d7b7679 commit 1df26c8

11 files changed

+695
-1296
lines changed

test/karma.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ module.exports = function(config) {
4444
browserConsoleLogOptions,
4545
client: {
4646
captureConsole,
47+
mocha: {
48+
timeout: 5000 // 5 seconds. Increase from default 2 seconds.
49+
}
4750
},
4851
customLaunchers: {
4952
FirefoxHeadless: {

test/src/config/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ var pluses = /\+/g,
635635
return window.mParticle.Identity.getCurrentUser()?.getMPID() === testMPID;
636636
},
637637
hasIdentityCallInflightReturned = () => !mParticle.getInstance()?._Store?.identityCallInFlight,
638-
hasConfigLoaded = () => !!mParticle.getInstance()?._Store?.configurationLoaded
638+
hasConfigurationReturned = () => !!mParticle.getInstance()?._Store?.configurationLoaded;
639639

640640
var TestsCore = {
641641
getLocalStorageProducts: getLocalStorageProducts,
@@ -664,7 +664,7 @@ var TestsCore = {
664664
fetchMockSuccess: fetchMockSuccess,
665665
hasIdentifyReturned: hasIdentifyReturned,
666666
hasIdentityCallInflightReturned,
667-
hasConfigLoaded,
667+
hasConfigurationReturned,
668668
};
669669

670670
export default TestsCore;

test/src/tests-batchUploader_3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ describe('batch uploader', () => {
229229
})
230230
});
231231

232-
it('should call the identity callback after a session ends if user is returning to the page after a long period of time', async function() {
232+
it('should call the identity callback after a session ends if user is returning to the page after a long period of time', async () => {
233233
// Background of bug that this test fixes:
234234
// User navigates away from page and returns after some time
235235
// and the session should end. There is a UAC firing inside of

0 commit comments

Comments
 (0)