Skip to content

Commit 180e4cf

Browse files
committed
fix(mocks): update return signature for ready()
Upon upgrading to the latest of several libraries (mostly Ionic and Angular), I started getting this error: typescript: test-config/mocks-ionic.ts, line: 7 Argument of type '"READY"' is not assignable to parameter of type '{ String: any; } | PromiseLike<{ String: any; }>'. The signature as it was looked for the promise to resolve with an object having a property called "String" which contained anything. The actual signature found here: https://github.com/ionic-team/ionic/blob/master/src/platform/platform.ts calls for the promise to be resolved with a string.
1 parent dc914c5 commit 180e4cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test-config/mocks-ionic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { StatusBar } from '@ionic-native/status-bar';
22
import { SplashScreen } from '@ionic-native/splash-screen';
33

44
export class PlatformMock {
5-
public ready(): Promise<{String}> {
5+
public ready(): Promise<string> {
66
return new Promise((resolve) => {
77
resolve('READY');
88
});

0 commit comments

Comments
 (0)