diff --git a/modules/entity/spec/utils.spec.ts b/modules/entity/spec/utils.spec.ts index ccbeb7de77..efa0fdeaf2 100644 --- a/modules/entity/spec/utils.spec.ts +++ b/modules/entity/spec/utils.spec.ts @@ -32,17 +32,19 @@ describe('Entity utils', () => { expect(spy).toHaveBeenCalled(); }); - xit('should not warn when key does not exist in prod mode', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(false); + it('should not warn when key does not exist in prod mode', () => { + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(false); const spy = spyOn(console, 'warn'); const key = selectIdValue(AClockworkOrange, (book: any) => book.foo); expect(spy).not.toHaveBeenCalled(); + + ngSpy.mockReset(); }); - xit('should not warn when key is undefined in prod mode', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(false); + it('should not warn when key is undefined in prod mode', () => { + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(false); const spy = spyOn(console, 'warn'); const undefinedAClockworkOrange = { ...AClockworkOrange, id: undefined }; @@ -52,6 +54,8 @@ describe('Entity utils', () => { ); expect(spy).not.toHaveBeenCalled(); + + ngSpy.mockReset(); }); }); }); diff --git a/modules/store/spec/runtime_checks.spec.ts b/modules/store/spec/runtime_checks.spec.ts index 55b6923a53..6fc0b0ec1f 100644 --- a/modules/store/spec/runtime_checks.spec.ts +++ b/modules/store/spec/runtime_checks.spec.ts @@ -38,8 +38,8 @@ describe('Runtime checks:', () => { }); }); - xit('should disable runtime checks in production by default', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(false); + it('should disable runtime checks in production by default', () => { + const spy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(false); expect(createActiveRuntimeChecks()).toEqual({ strictStateSerializability: false, @@ -49,10 +49,13 @@ describe('Runtime checks:', () => { strictActionWithinNgZone: false, strictActionTypeUniqueness: false, }); + + spy.mockReset(); + spy.mockReturnValue(true); }); - xit('should disable runtime checks in production even if opted in to enable', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(false); + it('should disable runtime checks in production even if opted in to enable', () => { + const spy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(false); expect( createActiveRuntimeChecks({ @@ -69,6 +72,9 @@ describe('Runtime checks:', () => { strictActionWithinNgZone: false, strictActionTypeUniqueness: false, }); + + spy.mockReset(); + spy.mockReturnValue(true); }); }); diff --git a/modules/store/spec/selector.spec.ts b/modules/store/spec/selector.spec.ts index a019cc9ef0..ec4c3f4171 100644 --- a/modules/store/spec/selector.spec.ts +++ b/modules/store/spec/selector.spec.ts @@ -491,38 +491,44 @@ describe('Selectors', () => { }); describe('Warning', () => { - xdescribe('should not log when: ', () => { + describe('should not log when: ', () => { it('the feature does exist', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(true); + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(true); const selector = createFeatureSelector('featureA'); selector({ featureA: {} }); expect(warnSpy).not.toHaveBeenCalled(); + + ngSpy.mockReset(); }); it('the feature key exist but is falsy', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(true); + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(true); const selector = createFeatureSelector('featureB'); selector({ featureA: {}, featureB: undefined }); expect(warnSpy).not.toHaveBeenCalled(); + + ngSpy.mockReset(); }); it('not in development mode', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(false); + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(false); const selector = createFeatureSelector('featureB'); selector({ featureA: {} }); expect(warnSpy).not.toHaveBeenCalled(); + + ngSpy.mockReset(); }); }); - xdescribe('warning will ', () => { + describe('warning will ', () => { it('be logged when not in mock environment', () => { - spyOn(ngCore, 'isDevMode').and.returnValue(true); + const ngSpy = jest.spyOn(ngCore, 'isDevMode').mockReturnValue(true); const selector = createFeatureSelector('featureB'); selector({ featureA: {} }); @@ -531,6 +537,8 @@ describe('Selectors', () => { expect(warnSpy.calls.mostRecent().args[0]).toMatch( /The feature name "featureB" does not exist/ ); + + ngSpy.mockReset(); }); it('not be logged when in mock environment', () => {