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: update babel-plugin-tester to v11 #1790

Merged
merged 1 commit into from
Aug 14, 2024
Merged

chore: update babel-plugin-tester to v11 #1790

merged 1 commit into from
Aug 14, 2024

Conversation

ripecosta
Copy link
Contributor

Description

Updates babel-plugin-tester to the latest version (v11).

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

@coveralls
Copy link

Coverage Status

coverage: 97.073%. remained the same
when pulling ad33ef2 on ripecosta:rc/babel-tester-v11
into 5b492e8 on i18next:master.

@@ -19,81 +19,81 @@ pluginTester({
babelOptions: { filename: __filename, parserOpts: { plugins: ['jsx'] } },
tests: [
`
import { Trans } from '../icu.macro'
import { Trans } from '../../../icu.macro'
Copy link
Contributor Author

@ripecosta ripecosta Aug 14, 2024

Choose a reason for hiding this comment

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

babel-plugin-tester v11 has a different folder structure so these imports had to be updated.

Copy link
Member

Choose a reason for hiding this comment

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

strange... but if it works, ok


const d = 1;
const outside = plural\`\${d}, =0 { # } other { chose # }\`;
`,
snapshot: false,
error: /"plural``" can only be used inside <Trans> in "[^"]+" on line 5/,
error: /"plural``" can only be used inside <Trans> in "[^"]+" on line 6/,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

v11 adds an empty line at the starts of the file so these lines numbers had to be updated.

"
`;

exports[`unknown plugin > 1. unknown plugin > 1. unknown plugin 1`] = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This massive deletion is due to a previous version of babel-plugin-tester no longer auto determining the name of a plugin, which left these obsolete snapshots in. It now determines the plugin name again, so these are safe to get rid of.

@adrai adrai merged commit e068e5e into i18next:master Aug 14, 2024
8 of 9 checks passed
@ripecosta
Copy link
Contributor Author

@adrai linting was failing in CI. Don't understand why yet but I'll try to fix it and raise a separate PR for it

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