Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Node.js 18, update dependencies #5

Merged
merged 3 commits into from
Jan 28, 2024

Conversation

tommy-mitchell
Copy link
Contributor

This PR:

  • Targets Node.js 18
  • Updates dependencies (specifically to get strip-ansi v7.1.0)
  • Improves tests, covering a previously untested case

Comment on lines +18 to +23
const error = await t.throwsAsync(execa('./cli.js', {stdin: 'inherit'}));

t.like(error, {
stderr: 'Input required',
exitCode: 1,
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...yeah, I guess it makes sense that the action runner's shell isn't TTY lol

Does execa have a way to simulate it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but you can force Chalk to use colors even when not interactive using an environment variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip-ansi-cli/cli.js

Lines 24 to 27 in 5ed811e

if (!input && process.stdin.isTTY) {
console.error('Input required');
process.exit(1);
}

It’s for this check, I’m not sure if that would help.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. You could use a PTY, but not worth the effort. Just skip that test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this workaround worked: tommy-mitchell@a8bb159

From actions/runner#241 (comment)

@sindresorhus sindresorhus merged commit f6a9d04 into chalk:main Jan 28, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants