Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 653f8e7

Browse files
committed
fixed tests
1 parent 59b4c8b commit 653f8e7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/core/src/logCodeManager.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isDev } from './utils';
2+
13
// The Log Code Manager keeps track
24
// and manages all important Logs of AgileTs.
35
//
@@ -163,8 +165,9 @@ const niceLogCodeMessages = {
163165
'00:03:01': "'${0}' has to be of the type ${1}!",
164166
};
165167

166-
const logCodeMessages: typeof niceLogCodeMessages =
167-
process.env.NODE_ENV === 'dev' ? niceLogCodeMessages : ({} as any);
168+
const logCodeMessages: typeof niceLogCodeMessages = isDev
169+
? niceLogCodeMessages
170+
: ({} as any);
168171

169172
/**
170173
* Returns the log message according to the specified log code.
@@ -258,7 +261,7 @@ function logIfTags<T extends LogCodesArrayType<typeof logCodeMessages>>(
258261
* @internal
259262
*/
260263
let tempLogCodeManager;
261-
if (typeof process === 'object' && process.env.NODE_ENV !== 'production') {
264+
if (isDev) {
262265
tempLogCodeManager = {
263266
getLog,
264267
log,

packages/core/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,6 @@ export const runsOnServer = (): boolean => {
272272
typeof window.document.createElement !== 'undefined'
273273
);
274274
};
275+
276+
export const isDev =
277+
typeof process === 'object' && process.env.NODE_ENV !== 'production';

0 commit comments

Comments
 (0)