-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Tooling: Integrate dependencies from WordPress packages #4705
Conversation
Tested:
I also wanted to test the browserslist change. To test this I ran I extracted the Results for
Results for this PR
I think that makes sense, we didn't expect any changes to vendor prefixes A 2nd pair of eyes on confirming if any unintended browser compatibility changes haven't gone missing would be great.... |
@ntwb, I want to include |
3ee0168
to
72acb99
Compare
@ntwb - this is ready for review. I included Jest preset and had to fully regenerate |
Sharing this link with Next.js tutorial how to extend their default configs: https://zeit.co/blog/next5#universal-webpack-and-next-plugins. Another way how we could tackle presets in the follow-up PRs. |
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.
Fantastic to see this all coming together now, LGTM 👍
@@ -151,12 +142,12 @@ | |||
"fixtures:generate": "npm run fixtures:server-registered && cross-env GENERATE_MISSING_FIXTURES=y npm run test-unit", | |||
"fixtures:regenerate": "npm run fixtures:clean && npm run fixtures:generate", | |||
"package-plugin": "./bin/build-plugin-zip.sh", | |||
"test-unit": "jest", | |||
"test-unit": "wp-scripts test", |
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 guess this is more a package issue, but I wonder if this command should be wp-scripts unit-test
to allow for other kind of test commands.
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.
In the future, we might have also e2e support but we are very far away from this :) We can rename it or add a flag like --type=unit
or something along those lines. At the moment it's a simple wrapper for jest
.
test/unit/pegjs-transform.js
Outdated
@@ -1,16 +0,0 @@ | |||
const pegjs = require( 'pegjs' ); |
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.
Don't we need this file anymore?
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.
Yes, some tests depend on the parser inside Gutenberg. I moved this to jest-preset-default in case someone ever uses the code that loads those files. Technically it all stays the same.
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.
Minor: Maybe, I'd have preferred this one to stay Gutenberg specific as it's not really a common thing to use pegjs
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 fine with leaving it here as suggested. I will update PR.
72acb99
to
384e590
Compare
"testMatch": [ | ||
"<rootDir>/(blocks|components|date|editor|element|i18n|data|utils|edit-post)/**/test/*.js" | ||
], | ||
"timers": "fake", | ||
"transform": { | ||
"^.+\\.jsx?$": "babel-jest", |
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.
@youknowriad it's back here. I had to reference babel-jest
here because it doesn't merge options with preset. I opened an issue in Jest to fix it: jestjs/jest#5505.
Description
This brings
wp-scripts
into Gutenberg.How Has This Been Tested?
Regression tests to confirm nothing has broken.
Run the following code and make sure they still work:
npm run build
npm run dev
npm run gettext-string
npm run package-plugin
npm run test-unit
Checklist: