-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support & test import() for non-bundled code (#1615)
* Test basic import syntax * Compile import() in test, only support syntax otherwise
- Loading branch information
Showing
3 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/react-scripts/fixtures/kitchensink/src/features/syntax/Promises.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import Promises from './Promises'; | ||
|
||
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 }) => { | ||
return new Promise(resolve => { | ||
ReactDOM.render(<Promises onReady={resolve} />, div); | ||
}); | ||
}); | ||
}); | ||
}); |