Fix mock test env check outside of browser

This commit is contained in:
Jamie Kyle 2024-04-16 13:13:02 -07:00 committed by GitHub
parent dbff1ab4d1
commit 3f074a7737
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 47 additions and 22 deletions

View file

@ -1,6 +1,8 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { isTestOrMockEnvironment } from '../environment';
/**
* Left-to-Right Isolate
* Sets direction to LTR and isolates the embedded content from the surrounding text
@ -208,7 +210,7 @@ export function _bidiIsolate(text: string): string {
* ```
*/
export function bidiIsolate(text: string): string {
if (window.SignalContext.isTestOrMockEnvironment()) {
if (isTestOrMockEnvironment()) {
// Turn this off in tests to make it easier to compare strings
return text;
}