-
Notifications
You must be signed in to change notification settings - Fork 3.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
feat(tests): Add a test to validate scripts/migration/renamings.js
#5980
Conversation
* Make scripts/migration/renamings.js a valid JSON5 file. * Add a schema for it in tests/migration/renamings-schema.json. * Add a script to test one against the other, as tests/migration/validate-renamings. It is a node.js script that will exit 0 if the renamings file is valid, or 1 if it is not (and print a not-very-helpful error message from which is possible, with some effort, to deduce what the error is.)
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.
I'm dubious about the reordering; let's discuss.
scripts/migration/renamings.json5
Outdated
@@ -11,8 +11,6 @@ | |||
* This file is in JSON5 format; see https://json5.org/. | |||
*/ | |||
|
|||
/* eslint-disable */ |
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.
Since eslint is more picky about formatting than JSON5.parse
(sensibly!), I wonder if we should still try to lint this file.
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.
Related plugin for doing so: https://github.com/bayesimpact/eslint-plugin-json5
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.
That looks useful but I think I want to postpone this to a later PR: there are some things I don't quite understand about our eslint setup.
This reverts commit efe070e.
And fix the resulting validation error in the example entry.
Tweaked line wrapping of some existing entries (example and acutal) that were otherwise untouched.
Also fixed extraneous whitespace in run_all_tests.sh
# Conflicts: # scripts/migration/renamings.js
Tests failing on Node v12 with |
Also remove success message, to adhere to usual unix convention (silence implies success) as eslint does, and reduce unecessary npm test output clutter.
OK, @gonfunko: this should now be ready for final review. |
* Fix typos. * Remove redundant check.
The basics
The details
Resolves
Resolves #5645.
Proposed Changes
scripts/migration/renamings.js
a valid JSON5 file.tests/migration/renamings-schema.json
.tests/migration/validate-renamings
.renamings.js
so that:tests/run_all_tests.sh
to runvalidate-renamings
.Behaviour Before Change
The renamings file existed, but it had a different format and there were no tests.
Behaviour After Change
Now we have a beautifully formatted, schema-ed renamings file that should serve all of our renaming needs.
Reason for Changes
Supporting handling renamings for people.
Test Coverage
This is tests!
Documentation
N/A
Additional Information
N/A