-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store): add ngrxMockEnvironment function to control output durin…
- Loading branch information
1 parent
534aa09
commit da1a0c0
Showing
7 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { isNgrxMockEnvironment, setNgrxMockEnvironment } from '../src/flags'; | ||
|
||
describe(`Store flags`, () => { | ||
describe(`isNgrxMockEnvironment()`, () => { | ||
it(`should return false by default`, () => { | ||
expect(isNgrxMockEnvironment()).toBe(false); | ||
}); | ||
|
||
it(`should return the correct flag`, () => { | ||
setNgrxMockEnvironment(true); | ||
expect(isNgrxMockEnvironment()).toBe(true); | ||
|
||
setNgrxMockEnvironment(false); | ||
expect(isNgrxMockEnvironment()).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
let _ngrxMockEnvironment = false; | ||
export function setNgrxMockEnvironment(value: boolean): void { | ||
_ngrxMockEnvironment = value; | ||
} | ||
export function isNgrxMockEnvironment(): boolean { | ||
return _ngrxMockEnvironment; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters