Skip to content

Commit

Permalink
Support & test import() for non-bundled code (facebook#1615)
Browse files Browse the repository at this point in the history
* Test basic import syntax

* Compile import() in test, only support syntax otherwise
  • Loading branch information
Timer authored Feb 25, 2017
1 parent 2c7e48d commit 8d29cbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fixtures/kitchensink/src/features/syntax/Promises.test.js
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);
});
});
});
});

0 comments on commit 8d29cbd

Please sign in to comment.