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

chore: node.js 12 compatibility for object snapshot test. #1084

Merged
merged 2 commits into from
Apr 24, 2019

Conversation

coreyfarrell
Copy link
Member

node.js 12 changes the format of util.inspect, this causes snapshot
mismatch. We only use object snapshot testing in one place so call
util.inspect manually with compact: false option to force consistent
output before / after node.js 12.


CC @isaacs not sure if tap@12 can/should do anything about this, kind of a tough situation as compact: false would be a breaking change for tap. Either way figure you might want to know about this.

@coveralls
Copy link

coveralls commented Apr 24, 2019

Coverage Status

Coverage remained the same at 96.82% when pulling 56e840b on coreyfarrell:node12-fix-snapshot into a7bc7ae on istanbuljs:master.

node.js 12 changes the format of `util.inspect`, this causes snapshot
mismatch.  Replace our one object snapshot with a JSON stringified array
of `[name, value]` pairs representing the object.  Use an array sorted
by names as JSON.stringify does not guaruntee order of elements in an
object.
@coreyfarrell
Copy link
Member Author

Apparently compact: false won't work anyways - it's not supported by node.js <=8.

@coreyfarrell coreyfarrell merged commit 6fc109f into istanbuljs:master Apr 24, 2019
@coreyfarrell coreyfarrell deleted the node12-fix-snapshot branch April 24, 2019 18:06
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