Skip to content

Commit

Permalink
more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jan 9, 2025
1 parent 1043e0e commit 4a332d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/js/internal/util/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ let exports = {
reset: "",
hasColors: false,
shouldColorize(stream: WriteStream) {
if (stream?.isTTY) return lazyGetColorDepth().$call(stream) > 2;
if (stream?.isTTY) {
const depth = lazyGetColorDepth().$call(stream);
console.error("stream is a tty with color depth", depth);
return depth > 2;
}

// do not cache these since users may update them as the process runs
const { NO_COLOR, NODE_DISABLE_COLORS, FORCE_COLOR } = process.env;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const msgErrBuf = Buffer.from(`${msgErr}\n`);

const args = [
'-e',
`console.log(process.env); console.log("${msgOut}"); console.error("${msgErr}");`,
`console.log("${msgOut}"); console.error("${msgErr}");`,
];

let ret;
Expand All @@ -48,9 +48,6 @@ function checkSpawnSyncRet(ret) {

function verifyBufOutput(ret) {
checkSpawnSyncRet(ret);
// FIXME: here for debugging. will be removed before PR is merged
console.log("====== parent env")
console.log(process.env)
assert.deepStrictEqual(ret.stdout.toString('utf8'), msgOutBuf.toString('utf8'));
assert.deepStrictEqual(ret.stdout, msgOutBuf);
assert.deepStrictEqual(ret.stderr.toString('utf8'), msgErrBuf.toString('utf8'));
Expand Down

0 comments on commit 4a332d2

Please sign in to comment.