Skip to content

Commit

Permalink
test: update ProgressPlugin test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Mar 12, 2023
1 parent 0904724 commit 94f8804
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node/nodeConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = ({ colors, appendOnly, stream }) => {

const writeStatusMessage = () => {
if (!currentStatusMessage) return;
const l = process.stderr.columns || 40;
const l = stream.columns || 40;
const args = truncateArgs(currentStatusMessage, l - 1);
const str = args.join(" ");
const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`;
Expand Down
2 changes: 2 additions & 0 deletions test/ProgressPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ describe("ProgressPlugin", function () {
activeModules: true
});

process.stderr.columns = 70;
return RunCompilerAsync(compiler).then(() => {
const logs = stderr.toString();

Expand All @@ -255,6 +256,7 @@ describe("ProgressPlugin", function () {
it("should get the custom handler text from the log", () => {
const compiler = createSimpleCompilerWithCustomHandler();

process.stderr.columns = 70;
return RunCompilerAsync(compiler).then(() => {
const logs = stderr.toString();
expect(logs).toEqual(
Expand Down

0 comments on commit 94f8804

Please sign in to comment.