-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add tests for named-asset-imports plugin #5575
Conversation
This is great. I suggested a few changes and we'll need to get this passing on CI. |
…med-asset-plugin-tests
Tests have been updated. please let me know if you think we need more tests to cover more cases. Thanks |
Can we make sure these tests run as part of e2e? Just add it somewhere in |
snapshot: false, | ||
tests: { | ||
defaultImport: { | ||
code: 'import logo from "logo";', |
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.
Is there a reason these don't include the file name? Why not import logo from 'logo.svg';
?
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.
The first 3 tests are testing cases when file extension does NOT match to plugin config (.svg
in here),
and rest can cover tests when imported file extension matches to config
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.
svgDefaultImport
covers default import of logo.svg
@@ -118,6 +118,10 @@ cd packages/react-dev-utils/ | |||
yarn test | |||
cd ../.. | |||
|
|||
cd packages/babel-plugin-named-asset-import/ |
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.
@Timer tests run as part of e2e
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.
LGTM, @iansu proceed with merge when you're happy.
Thanks! |
Some automation tests added to test named-asset-imports plugin
Hot to run
OR