diff --git a/test/app.test.ts b/test/app.test.ts index d825863..ca2a05f 100644 --- a/test/app.test.ts +++ b/test/app.test.ts @@ -64,14 +64,14 @@ describe('test/app.test.ts', () => { await app.load(manifest.default, appDir); app.run(); - expect((app as any).state === ArtusApplicationState.STARTING); + expect((app as any).state).toBe(ArtusApplicationState.STARTING); await new Promise(resolve => setTimeout(resolve, 1000)); - expect((app as any).state === ArtusApplicationState.STARTED); + expect((app as any).state).toBe(ArtusApplicationState.STARTED); app.close(); - expect((app as any).state === ArtusApplicationState.CLOSING); + expect((app as any).state).toBe(ArtusApplicationState.CLOSING); await new Promise(resolve => setTimeout(resolve, 1000)); - expect((app as any).state === ArtusApplicationState.CLOSED); + expect((app as any).state).toBe(ArtusApplicationState.CLOSED); }); it('should state set to error', async () => { @@ -83,18 +83,18 @@ describe('test/app.test.ts', () => { // test run await app.run().catch(() => null); - expect((app as any).state === ArtusApplicationState.START_ERROR); + expect((app as any).state).toBe(ArtusApplicationState.START_ERROR); mm.restore(); await app.run(); - expect((app as any).state === ArtusApplicationState.STARTED); + expect((app as any).state).toBe(ArtusApplicationState.STARTED); // test close mm(LifecycleManager.prototype, 'emitHook', () => Promise.reject('err')); await app.close().catch(() => null); - expect((app as any).state === ArtusApplicationState.CLOSE_ERROR); + expect((app as any).state).toBe(ArtusApplicationState.CLOSE_ERROR); mm.restore(); await app.close(); - expect((app as any).state === ArtusApplicationState.CLOSED); + expect((app as any).state).toBe(ArtusApplicationState.CLOSED); }); }); });