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

infrastructure: move unit-test to stable JSON stringify #2060

Open
ljqx opened this issue Dec 7, 2020 · 0 comments
Open

infrastructure: move unit-test to stable JSON stringify #2060

ljqx opened this issue Dec 7, 2020 · 0 comments

Comments

@ljqx
Copy link
Contributor

ljqx commented Dec 7, 2020

Now unit-test uses JSON.stringify to generate fixtures.

JSON.stringify is not stable across different environment (Node versions/platform).

This means, when there is a new property added to ESTree nodes, and we want to regenerate fixtures for existing unit tests, the generated fixtures would mostly be largely mismatched to the original one, which makes it hard to review.

It's better to stabilize the output, then it's easier for the dev process.

We can leverage existing libraries like https://github.com/substack/json-stable-stringify or https://github.com/epoberezkin/fast-json-stable-stringify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant