-
-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Speed up TypeScript projects (#5903)""
This reverts commit 544a594.
- Loading branch information
1 parent
c6eca6e
commit 9581519
Showing
11 changed files
with
193 additions
and
43 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
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
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const testSetup = require('../__shared__/test-setup'); | ||
const puppeteer = require('puppeteer'); | ||
|
||
const expectedErrorMsg = `Argument of type '123' is not assignable to parameter of type 'string'`; | ||
|
||
test('shows error overlay in browser', async () => { | ||
const { port, done } = await testSetup.scripts.start(); | ||
|
||
const browser = await puppeteer.launch({ headless: true }); | ||
try { | ||
const page = await browser.newPage(); | ||
await page.goto(`http://localhost:${port}/`); | ||
await page.waitForSelector('iframe', { timeout: 5000 }); | ||
const overlayMsg = await page.evaluate(() => { | ||
const overlay = document.querySelector('iframe').contentWindow; | ||
return overlay.document.body.innerHTML; | ||
}); | ||
expect(overlayMsg).toContain(expectedErrorMsg); | ||
} finally { | ||
browser.close(); | ||
done(); | ||
} | ||
}); | ||
|
||
test('shows error in console (dev mode)', async () => { | ||
const { stderr } = await testSetup.scripts.start({ smoke: true }); | ||
expect(stderr).toContain(expectedErrorMsg); | ||
}); | ||
|
||
test('shows error in console (prod mode)', async () => { | ||
const { stderr } = await testSetup.scripts.build(); | ||
expect(stderr).toContain(expectedErrorMsg); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"dependencies": { | ||
"@types/react": "*", | ||
"@types/react-dom": "*", | ||
"react": "*", | ||
"react-dom": "*", | ||
"typescript": "3.1.3" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from 'react'; | ||
|
||
class App extends React.Component { | ||
render() { | ||
return <div>{format(123)}</div>; | ||
} | ||
} | ||
|
||
function format(value: string) { | ||
return value; | ||
} | ||
|
||
export default App; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |