@jsenv/test 3.0.14 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jsenv_test.js
CHANGED
|
@@ -5,7 +5,6 @@ import { takeCoverage } from "node:v8";
|
|
|
5
5
|
import stripAnsi from "strip-ansi";
|
|
6
6
|
import { URL_META, createException } from "./js/exception.js";
|
|
7
7
|
import stringWidth from "string-width";
|
|
8
|
-
import { isBrowser } from "environment";
|
|
9
8
|
import tty from "node:tty";
|
|
10
9
|
import { pathToFileURL, fileURLToPath } from "node:url";
|
|
11
10
|
import { dirname } from "node:path";
|
|
@@ -619,6 +618,50 @@ const error = (...args) => console.error(...args);
|
|
|
619
618
|
|
|
620
619
|
const errorDisabled = () => {};
|
|
621
620
|
|
|
621
|
+
/* globals WorkerGlobalScope, DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, ServiceWorkerGlobalScope */
|
|
622
|
+
|
|
623
|
+
const isBrowser = globalThis.window?.document !== undefined;
|
|
624
|
+
|
|
625
|
+
globalThis.process?.versions?.node !== undefined;
|
|
626
|
+
|
|
627
|
+
globalThis.process?.versions?.bun !== undefined;
|
|
628
|
+
|
|
629
|
+
globalThis.Deno?.version?.deno !== undefined;
|
|
630
|
+
|
|
631
|
+
globalThis.process?.versions?.electron !== undefined;
|
|
632
|
+
|
|
633
|
+
globalThis.navigator?.userAgent?.includes('jsdom') === true;
|
|
634
|
+
|
|
635
|
+
typeof WorkerGlobalScope !== 'undefined' && globalThis instanceof WorkerGlobalScope;
|
|
636
|
+
|
|
637
|
+
typeof DedicatedWorkerGlobalScope !== 'undefined' && globalThis instanceof DedicatedWorkerGlobalScope;
|
|
638
|
+
|
|
639
|
+
typeof SharedWorkerGlobalScope !== 'undefined' && globalThis instanceof SharedWorkerGlobalScope;
|
|
640
|
+
|
|
641
|
+
typeof ServiceWorkerGlobalScope !== 'undefined' && globalThis instanceof ServiceWorkerGlobalScope;
|
|
642
|
+
|
|
643
|
+
// Note: I'm intentionally not DRYing up the other variables to keep them "lazy".
|
|
644
|
+
const platform = globalThis.navigator?.userAgentData?.platform;
|
|
645
|
+
|
|
646
|
+
platform === 'macOS'
|
|
647
|
+
|| globalThis.navigator?.platform === 'MacIntel' // Even on Apple silicon Macs.
|
|
648
|
+
|| globalThis.navigator?.userAgent?.includes(' Mac ') === true
|
|
649
|
+
|| globalThis.process?.platform === 'darwin';
|
|
650
|
+
|
|
651
|
+
platform === 'Windows'
|
|
652
|
+
|| globalThis.navigator?.platform === 'Win32'
|
|
653
|
+
|| globalThis.process?.platform === 'win32';
|
|
654
|
+
|
|
655
|
+
platform === 'Linux'
|
|
656
|
+
|| globalThis.navigator?.platform?.startsWith('Linux') === true
|
|
657
|
+
|| globalThis.navigator?.userAgent?.includes(' Linux ') === true
|
|
658
|
+
|| globalThis.process?.platform === 'linux';
|
|
659
|
+
|
|
660
|
+
platform === 'Android'
|
|
661
|
+
|| globalThis.navigator?.platform === 'Android'
|
|
662
|
+
|| globalThis.navigator?.userAgent?.includes(' Android ') === true
|
|
663
|
+
|| globalThis.process?.platform === 'android';
|
|
664
|
+
|
|
622
665
|
const ESC = '\u001B[';
|
|
623
666
|
|
|
624
667
|
!isBrowser && process$1.env.TERM_PROGRAM === 'Apple_Terminal';
|
|
@@ -5150,7 +5193,7 @@ const renderConsoleOutput = (consoleCalls) => {
|
|
|
5150
5193
|
const textFormatted = prefixFirstAndIndentRemainingLines({
|
|
5151
5194
|
prefix: CONSOLE_ICONS[regroupedCall.type],
|
|
5152
5195
|
text,
|
|
5153
|
-
trimLines:
|
|
5196
|
+
trimLines: false,
|
|
5154
5197
|
trimLastLine: index === regroupedCalls.length - 1,
|
|
5155
5198
|
});
|
|
5156
5199
|
consoleOutput += textFormatted;
|
package/package.json
CHANGED
|
@@ -494,7 +494,7 @@ const renderConsoleOutput = (consoleCalls) => {
|
|
|
494
494
|
const textFormatted = prefixFirstAndIndentRemainingLines({
|
|
495
495
|
prefix: CONSOLE_ICONS[regroupedCall.type],
|
|
496
496
|
text,
|
|
497
|
-
trimLines:
|
|
497
|
+
trimLines: false,
|
|
498
498
|
trimLastLine: index === regroupedCalls.length - 1,
|
|
499
499
|
});
|
|
500
500
|
consoleOutput += textFormatted;
|