Force unicode in integrationTestHelpers
MODIFY
packages/@romejs/cli-reporter/Reporter.ts
packages/@romejs/cli-reporter/Reporter.ts
@@ -26,6 +26,7 @@ import {
ReporterTableField,
SelectArguments,
SelectOptions,
+ Stdout,
} from "./types";
import {removeSuffix} from "@romejs/string-utils";
import Progress from "./Progress";
@@ -85,11 +86,6 @@ type QuestionOptions = {
let remoteProgressIdCounter = 0;
-type Stdout = stream.Writable & {
- isTTY?: boolean;
- columns?: number;
-};
-
function getStreamFormat(stdout: undefined | Stdout): ReporterStream["format"] {
return stdout !== undefined && stdout.isTTY === true ? "ansi" : "none";
}
@@ -155,7 +151,10 @@ export default class Reporter {
});
// Windows terminals are awful
- const unicode = process.platform !== "win32";
+ const unicode =
+ stdout !== undefined && stdout.unicode !== undefined
+ ? stdout.unicode
+ : process.platform !== "win32";
const outStream: ReporterStream = {
type: "out",

MODIFY
packages/@romejs/cli-reporter/types.ts
packages/@romejs/cli-reporter/types.ts
*/
import {Event} from "@romejs/events";
+import stream = require("stream");
+
+export type Stdout = stream.Writable & {
+ unicode?: boolean;
+ isTTY?: boolean;
+ columns?: number;
+};
export type SelectOption = {
label: string;

MODIFY
packages/@romejs/core/integrationTestHelpers.ts
packages/@romejs/core/integrationTestHelpers.ts
@@ -12,6 +12,7 @@ import {
removeDirectory,
writeFile,
} from "@romejs/fs";
+import {Stdout} from "@romejs/cli-reporter";
import {Dict} from "@romejs/typescript-helpers";
import {UserConfig} from "./common/userConfig";
import crypto = require("crypto");
@@ -100,12 +101,13 @@ export function createIntegrationTest(
// Mock and capture stdout
let console = "";
- const stdout = new stream.Writable({
+ const stdout: Stdout = new stream.Writable({
write(chunk, encoding, callback) {
console += chunk;
callback();
},
});
+ stdout.unicode = true;
// Create a Client. The abstraction used by the CLI.
const client = new Client({

Force unicode in integrationTestHelpers