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

make tests compatible with Node.js 12 #3304

Merged
merged 1 commit into from
Mar 12, 2019
Merged

Conversation

silverwind
Copy link
Contributor

In Node.js 12, the formatting of console arguments will change slightly. Previously, a string other than the first argument was formatted using single quotes if the first argument was non-string. Now, quotes are never added regardless of position of a string argument.

To make test compatible in all Node.js versions, I work around by ensuring the first argument to console.log is a string which prevents the quotes from being added on older versions of Node.js.

Ref: nodejs/node#23162

In Node.js 12, the formatting of console arguments will change slightly.
Previously, a string other than the first argument was formatted using
single quotes if the first argument was non-string. Now, quotes are
never added regardless of position of a string argument.

To make test compatible in all Node.js versions, I work around by
ensuring the first argument to console.log is a string which prevents
the quotes from being added on older versions of Node.js.

Ref: nodejs/node#23162
@alexlamsl
Copy link
Collaborator

Pretty clever workaround, thanks! 👍

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.

2 participants