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

#668 remove custom stringify function in test #670

Merged
merged 5 commits into from
May 24, 2024
Merged

Conversation

smellman
Copy link
Contributor

#668 Remove custom stringify function in test/lib/utils.ts

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.56%. Comparing base (959f8cc) to head (c48e5ec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #670      +/-   ##
==========================================
+ Coverage   92.45%   92.56%   +0.11%     
==========================================
  Files         104      104              
  Lines        4624     4616       -8     
  Branches     1303     1301       -2     
==========================================
- Hits         4275     4273       -2     
+ Misses        349      343       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HarelM
Copy link
Collaborator

HarelM commented May 18, 2024

Thanks for taking the time to open this PR!
There is a comment above the removed function about stringify of test cases results.
Did you try and run the tests with UPDATE=1 and see which files change?
Maybe we can save them after the regular stringify?

@HarelM
Copy link
Collaborator

HarelM commented May 23, 2024

@smellman any updates on the above question?

@smellman
Copy link
Contributor Author

@HarelM Running UPDATE=1 npm run test generates many differences in JSON files.
I have committed these changes to the dev-668-update-1 branch.
smellman@cd1574a
Normally, UPDATE=1 is recognized as making destructive changes to make it harder to alter these files.

@HarelM
Copy link
Collaborator

HarelM commented May 24, 2024

It's true that update=1 does destructive updates, but the difference between json compact and regular json stigngify should not be dramatic.

It's also worth mentioning that we are using this library for the docs, so I'm not sure we will be able to remove it completely even if we remove this method. Just FYI.

CHANGELOG.md Outdated Show resolved Hide resolved
@smellman
Copy link
Contributor Author

I just upload smellman@947ebcf with 2 space.
It may be a bit dramatic.

@HarelM
Copy link
Collaborator

HarelM commented May 24, 2024

I'm trying to understand if we can use a replacer in the json stringify to support both these tests, but more importantly, the docs, which basically suffers from the same issue:
Expression, which are basically an array, are expanded to new lines, which makes them harder to read.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#replacer

In any case, I went over the expression test files and they look ok to me.

So feel free to research the above or commit the file changes as is.

@smellman
Copy link
Contributor Author

My understanding is that the replacer is not same as the formatter.
Therefore, I have uploaded all converted files.

Copy link
Collaborator

@HarelM HarelM left a comment

Choose a reason for hiding this comment

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

Thanks!

@HarelM HarelM merged commit 52f248f into maplibre:main May 24, 2024
6 checks passed
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