-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make frontend unit test code could know it is in testing (#32656)
See the comment of isInFrontendUnitTest
- Loading branch information
1 parent
846f618
commit 5a50b27
Showing
2 changed files
with
10 additions
and
3 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
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,6 @@ | ||
// there could be different "testing" concepts, for example: backend's "setting.IsInTesting" | ||
// even if backend is in testing mode, frontend could be complied in production mode | ||
// so this function only checks if the frontend is in unit testing mode (usually from *.test.ts files) | ||
export function isInFrontendUnitTest() { | ||
return process.env.TEST === 'true'; | ||
} |