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

test: collect stdout/stderr in tests #3615

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

pavelfeldman
Copy link
Member

No description provided.

require('../../..');

it('stdio', () => {
process.stdout.write('stdout text');
Copy link
Contributor

@JoelEinbinder JoelEinbinder Aug 25, 2020

Choose a reason for hiding this comment

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

Does this work with console logs? I'm scared about our method of overwriting process.stdout.write.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does, i'm adding a test.

process.stdout.write('stdout text');
process.stdout.write(Buffer.from('stdout buffer'));
process.stderr.write('stderr text');
process.stderr.write(Buffer.from('stderr buffer'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
process.stderr.write(Buffer.from('stderr buffer'));
process.stderr.write(Buffer.from('stderr buffer'));
console.log('console log');
console.error('console.error');

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, added a separate test!

@pavelfeldman pavelfeldman force-pushed the reporter14 branch 2 times, most recently from ec2dbd5 to ce08eab Compare August 25, 2020 17:09
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.

3 participants