-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tools: add node-pty as a dependency #47793
Conversation
Review requested:
|
8c96ecf
to
dc38eb4
Compare
@MoLow Can you add an eslint rule to inhibit requiring/using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License file is missing
@@ -14,12 +14,13 @@ function replaceSpecDuration(str) { | |||
return str | |||
.replaceAll(/\(0(\r?\n)ms\)/g, '(ZEROms)') | |||
.replaceAll(/[0-9.]+ms/g, '*ms') | |||
.replaceAll(/duration_ms [0-9.]+/g, 'duration_ms *'); | |||
.replaceAll(/duration_ms [0-9.]+/g, 'duration_ms *') | |||
.replace(new RegExp(`(\\u001b\\[\\d+m)\\(${process.cwd()}/?(\\u001b\\[\\d+m)(.*)(\\u001b\\[\\d+m)\\)`, 'g'), '$3'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment to this line and explain what it does?
} | ||
const defaultTransform = snapshot | ||
.transform(snapshot.replaceWindowsLineEndings, snapshot.replaceStackTrace, replaceTestDuration); | ||
const specTransform = snapshot | ||
.transform(snapshot.replaceWindowsLineEndings, snapshot.replaceStackTrace, replaceSpecDuration); | ||
.transform(replaceSpecDuration, snapshot.replaceWindowsLineEndings, snapshot.replaceStackTrace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we have to change the ordering of this transform? Would it be helpful to document this with a comment?
To avoid confusion with actual |
I think that is relevant for deps, not for tools, see #47793 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain what problem node-pty
solves here, and how it worked before?
@@ -53,9 +82,11 @@ async function assertSnapshot(actual, filename = process.argv[1]) { | |||
* @param {function(string): string} [transform] | |||
* @returns {Promise<void>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? it still returns Promise<void>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, either GitHub or myself messed up the reference. I meant to select the entire doc comment, not just the @returns
line. Specifically, shouldn't a @param
be added?
Sure. the current node/test/pseudo-tty/pty_helper.py Line 3 in d225d95
as part of the effort of migrating the message tests to use common.assertSnapshot this will allow running as any other test under tests/parallel .
|
@nodejs/node-api any idea why the build is failing on mac? https://github.com/nodejs/node/actions/runs/4846084398/jobs/8635397424 |
|
closing in favor of #47803, wich is much simpler |
this is another followup for #47498 enabling running pseudo-tty snapshot tests using https://github.com/microsoft/node-pty
see #47793 (comment) for the reasoning behind this change