MOBILE-3320 tests: Fix tests

main
Noel De Martin 2020-10-15 12:11:07 +02:00
parent df7c68b07c
commit 62bc96a4df
5 changed files with 14 additions and 18 deletions

View File

@ -489,14 +489,11 @@ export class CoreAppProvider {
this.ssoAuthenticationDeferred = CoreUtils.instance.promiseDefer<void>();
// Resolve it automatically after 10 seconds (it should never take that long).
const cancelTimeout = setTimeout(() => {
this.finishSSOAuthentication();
}, 10000);
const cancelTimeout = setTimeout(() => this.finishSSOAuthentication(), 10000);
// If the promise is resolved because finishSSOAuthentication is called, stop the cancel promise.
this.ssoAuthenticationDeferred.promise.then(() => {
clearTimeout(cancelTimeout);
});
// eslint-disable-next-line promise/catch-or-return
this.ssoAuthenticationDeferred.promise.then(() => clearTimeout(cancelTimeout));
}
/**

View File

@ -248,8 +248,7 @@ export class CoreLangProvider {
return language;
}).catch(() =>
// Error getting locale. Use default language.
this.defaultLanguage,
);
this.defaultLanguage);
} catch (err) {
// Error getting locale. Use default language.
return Promise.resolve(this.defaultLanguage);

View File

@ -6,8 +6,8 @@
"cordova-plugin-file-transfer",
"cordova-plugin-inappbrowser",
"cordova",
"node",
"dom-mediacapture-record"
"dom-mediacapture-record",
"node"
],
"paths": {
"@/*": ["*"],

View File

@ -21,9 +21,9 @@
"cordova-plugin-file-transfer",
"cordova-plugin-inappbrowser",
"cordova",
"dom-mediacapture-record",
"jest",
"node",
"dom-mediacapture-record"
"node"
],
"paths": {
"@/*": ["*"],

View File

@ -1,14 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/tests",
"allowJs": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"outDir": "./out-tsc/tests",
"types": [
"cordova-plugin-file-transfer",
"cordova-plugin-inappbrowser",
"cordova",
"dom-mediacapture-record",
"jest",
"node"
],
@ -31,8 +32,7 @@
"src/polyfills.ts"
],
"include": [
"src/**/*.test.ts",
"src/**/*.d.ts",
"src/tests/**/*.ts"
"src/**/*.ts",
"src/**/*.d.ts"
]
}