-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Support & test import() for non-bundled code #1615
Conversation
Well... this is weird. "Test basic import syntax" passed ... it should've failed. 🤔 edit: ignore this, it does fail but not on CI -- why? see below. |
9c57a84
to
2ac84ea
Compare
Maybe we could try running Jest with |
I want to see a failing CI test 😢 |
I wonder if our CI tests even work ... |
/cc @EnoahNetzach |
Back when I was working on CI tests, I tried to make it fail (e.g. with #1160), and my tests always failed correctly.. Also, running this branch in a docker container EnoahNetzach:create-react-app/local-testing won't fail. Did you link babel-preset-react-app? I just tested it and without the link it was failing. |
|
||
describe('promises', () => { | ||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
return new Promise(resolve => { | ||
ReactDOM.render(<Promises onReady={resolve} />, div); | ||
return import('./Promises').then(({ default: Promises }) => { |
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.
wouldn't it be better to give import
its own test case?
747263e
to
40ac3c6
Compare
@gaearon I think the tests are just flaky (for an unknown reason). Should I create a new PR? |
Flaky as in "sometimes fails when it shouldn't" is understandable and fine. |
Okay, so it passes when the other commit it present. a373aec fails when c2ab8fb is missing, but a373aec starts passing when c2ab8fb is present. So I'm not sure if this is a travis bug or a e2e bug (or just how travis works). If it was a e2e bug that means we're somehow grabbing the latest. A travis bug would mean they're grabbing the latest PR and not that specific commit. |
Looks like travis does tl;dr this should be safe to land |
Do you mean that it might display a previous commit has passed while in reality it has grabbed the most recent pushed commit (that hasn't reached the queue yet)? |
That's exactly what it does. But only for PRs. Basically if you push a broken commit A, and then push a working commit B before the travis job starts for commit A, commit A will pass because it grabs commit B. |
OK, that makes sense.
|
That would be it. 😄 edit for people for people looking from twitter: this only affects pull requests, not branches |
OK today I learned. 😅 |
I noticed this when I pushed the second commit shortly after the first, because Node 4 kitchensink had started (and failed) and then the Node 6 kitchensink (queued not executing when I pushed second commit) succeeded. I then re-validated my theory by only running the first commit alone then pushing the second commit and re-running the first job, seeing it magically switch from failing to passing. Think this is worthwhile enough to report to travis? Prob the intended functionality... Confusing never the less. |
Meh, I guess this is as designed. |
Good job figuring it out tho |
Thanks! Good to land? |
Yep |
Just to clarify, because the wording of "effectively fetching commit B" confused me a bit: This is because Travis wants to use the post-merge commit – ie, when a push on a PR happens and GitHub checks if it is "ok to merge", GitHub actually performs the merge itself between the current state of the PR branch and the branch it's been opened on (eg, master). The resulting commit (which is only available remotely, as something like If GitHub offered a reference like |
* Test basic import syntax * Compile import() in test, only support syntax otherwise
No description provided.