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

tests: use readJson instead of imports for json #14020

Merged
merged 2 commits into from
May 24, 2022
Merged

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented May 17, 2022

To prepare for using mocha instead of jest, we need to drop all the json imports (which jest supports, but mocha does not, because mocha is "just node").

I used a regex to do the bulk of the migration:

import (.*) from ('.*\.json')
const $1 = readJson($2, import.meta)

I also configured the max-len lint rule to ignore any line that uses readJson: ignorePattern: 'readJson\\(',

@connorjclark connorjclark requested a review from a team as a code owner May 17, 2022 23:17
@connorjclark connorjclark requested review from brendankenny and removed request for a team May 17, 2022 23:17
@brendankenny
Copy link
Member

Can the incremental steps also wait on #14018? These lines were just all changed the other way in #13295 and I feel like we're in danger of hysteresis until we're sure we're going to make the mocha plunge (and not have to change our minds again if we run into some other immovable barrier)

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

Successfully merging this pull request may close these issues.

4 participants