Skip to content

Commit

Permalink
Add create-react-app and puppeteer user tests (#23471)
Browse files Browse the repository at this point in the history
* Add create-react-app

* Add puppeteer

Everything is broken now. I am going back to master to see if that fixes
things.

* Add puppeteer baseline

* Add chalk override (gitignore was ignoring it)
  • Loading branch information
sandersn authored Apr 17, 2018
1 parent d009d8e commit db68075
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 60 deletions.
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
ignore = all
[submodule "tests/cases/user/create-react-app/create-react-app"]
path = tests/cases/user/create-react-app/create-react-app
url = https://github.com/facebook/create-react-app.git
ignore = all
[submodule "tests/cases/user/webpack/webpack"]
path = tests/cases/user/webpack/webpack
url = https://github.com/webpack/webpack.git
ignore = all
[submodule "tests/cases/user/puppeteer/puppeteer"]
path = tests/cases/user/puppeteer/puppeteer
url = https://github.com/GoogleChrome/puppeteer.git
2 changes: 1 addition & 1 deletion src/harness/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
if (fs.existsSync(path.join(cwd, "node_modules"))) {
require("del").sync(path.join(cwd, "node_modules"), { force: true });
}
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout: timeout / 2, shell: true, stdio }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
const install = cp.spawnSync(`npm`, ["i", "--ignore-scripts"], { cwd, timeout: timeout / 2, shell: true, stdio }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);
}
const args = [path.join(__dirname, "tsc.js")];
Expand Down
79 changes: 79 additions & 0 deletions tests/baselines/reference/user/create-react-app.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Exit Code: 1
Standard output:
packages/babel-preset-react-app/dependencies.js(38,17): error TS2307: Cannot find module '@babel/preset-env'.
packages/babel-preset-react-app/dependencies.js(49,17): error TS2307: Cannot find module '@babel/preset-env'.
packages/babel-preset-react-app/index.js(52,17): error TS2307: Cannot find module '@babel/preset-env'.
packages/babel-preset-react-app/index.js(61,17): error TS2307: Cannot find module '@babel/preset-env'.
packages/babel-preset-react-app/index.js(74,17): error TS2307: Cannot find module '@babel/preset-react'.
packages/babel-preset-react-app/index.js(84,33): error TS2307: Cannot find module '@babel/preset-flow'.
packages/babel-preset-react-app/index.js(89,15): error TS2307: Cannot find module 'babel-plugin-macros'.
packages/babel-preset-react-app/index.js(93,15): error TS2307: Cannot find module '@babel/plugin-transform-destructuring'.
packages/babel-preset-react-app/index.js(98,17): error TS2307: Cannot find module '@babel/plugin-proposal-class-properties'.
packages/babel-preset-react-app/index.js(107,17): error TS2307: Cannot find module '@babel/plugin-proposal-object-rest-spread'.
packages/babel-preset-react-app/index.js(114,17): error TS2307: Cannot find module '@babel/plugin-transform-runtime'.
packages/babel-preset-react-app/index.js(123,17): error TS2307: Cannot find module 'babel-plugin-transform-react-remove-prop-types'.
packages/babel-preset-react-app/index.js(130,17): error TS2307: Cannot find module '@babel/plugin-transform-regenerator'.
packages/babel-preset-react-app/index.js(137,15): error TS2307: Cannot find module '@babel/plugin-syntax-dynamic-import'.
packages/babel-preset-react-app/index.js(140,17): error TS2307: Cannot find module 'babel-plugin-transform-dynamic-import'.
packages/confusing-browser-globals/test.js(14,1): error TS2304: Cannot find name 'it'.
packages/confusing-browser-globals/test.js(15,3): error TS2304: Cannot find name 'expect'.
packages/confusing-browser-globals/test.js(18,1): error TS2304: Cannot find name 'it'.
packages/confusing-browser-globals/test.js(19,3): error TS2304: Cannot find name 'expect'.
packages/create-react-app/createReactApp.js(37,37): error TS2307: Cannot find module 'validate-npm-package-name'.
packages/create-react-app/createReactApp.js(47,24): error TS2307: Cannot find module 'tar-pack'.
packages/create-react-app/createReactApp.js(49,28): error TS2307: Cannot find module 'hyperquest'.
packages/create-react-app/createReactApp.js(50,25): error TS2307: Cannot find module 'envinfo'.
packages/create-react-app/createReactApp.js(52,30): error TS2307: Cannot find module 'react-dev-utils/workspaceUtils'.
packages/create-react-app/createReactApp.js(53,29): error TS2307: Cannot find module './package.json'.
packages/create-react-app/createReactApp.js(771,20): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
packages/create-react-app/index.js(45,5): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
packages/eslint-config-react-app/index.js(24,33): error TS2307: Cannot find module 'confusing-browser-globals'.
packages/react-dev-utils/FileSizeReporter.js(13,24): error TS2307: Cannot find module 'filesize'.
packages/react-dev-utils/FileSizeReporter.js(14,25): error TS2307: Cannot find module 'recursive-readdir'.
packages/react-dev-utils/FileSizeReporter.js(16,24): error TS2307: Cannot find module 'gzip-size'.
packages/react-dev-utils/WebpackDevServerUtils.js(9,25): error TS2307: Cannot find module 'address'.
packages/react-dev-utils/WebpackDevServerUtils.js(14,24): error TS2307: Cannot find module 'detect-port-alt'.
packages/react-dev-utils/WebpackDevServerUtils.js(15,24): error TS2307: Cannot find module 'is-root'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(12,1): error TS2304: Cannot find name 'describe'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(13,3): error TS2304: Cannot find name 'it'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(18,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(19,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(22,3): error TS2304: Cannot find name 'it'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(26,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(29,3): error TS2304: Cannot find name 'it'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(36,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(37,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(40,3): error TS2304: Cannot find name 'it'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(46,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(49,3): error TS2304: Cannot find name 'it'.
packages/react-dev-utils/__tests__/ignoredFiles.test.js(53,5): error TS2304: Cannot find name 'expect'.
packages/react-dev-utils/browsersHelper.js(9,30): error TS2307: Cannot find module 'browserslist'.
packages/react-dev-utils/browsersHelper.js(13,23): error TS2307: Cannot find module 'pkg-up'.
packages/react-dev-utils/browsersHelper.js(59,22): error TS2554: Expected 1 arguments, but got 0.
packages/react-dev-utils/browsersHelper.js(61,36): error TS2345: Argument of type 'Buffer' is not assignable to parameter of type 'string'.
packages/react-dev-utils/browsersHelper.js(97,25): error TS2538: Type 'undefined' cannot be used as an index type.
packages/react-dev-utils/checkRequiredFiles.js(19,34): error TS2339: Property 'F_OK' does not exist on type 'typeof import("fs")'.
packages/react-dev-utils/checkRequiredFiles.js(23,32): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'string'.
packages/react-dev-utils/checkRequiredFiles.js(24,34): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'string'.
packages/react-dev-utils/getProcessForPort.js(29,6): error TS2339: Property 'split' does not exist on type 'Buffer'.
packages/react-dev-utils/getProcessForPort.js(49,21): error TS2339: Property 'replace' does not exist on type 'Buffer'.
packages/react-dev-utils/getProcessForPort.js(63,5): error TS2339: Property 'trim' does not exist on type 'Buffer'.
packages/react-dev-utils/openBrowser.js(13,19): error TS2307: Cannot find module 'opn'.
packages/react-dev-utils/webpackHotDevClient.js(19,22): error TS2307: Cannot find module 'sockjs-client'.
packages/react-dev-utils/webpackHotDevClient.js(24,28): error TS2307: Cannot find module 'react-error-overlay'.
packages/react-dev-utils/webpackHotDevClient.js(31,14): error TS2339: Property 'encodeURIComponent' does not exist on type 'Window'.
packages/react-dev-utils/webpackHotDevClient.js(33,14): error TS2339: Property 'encodeURIComponent' does not exist on type 'Window'.
packages/react-dev-utils/webpackHotDevClient.js(35,14): error TS2339: Property 'encodeURIComponent' does not exist on type 'Window'.
packages/react-dev-utils/webpackHotDevClient.js(53,12): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/webpackHotDevClient.js(53,33): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/webpackHotDevClient.js(54,10): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/webpackHotDevClient.js(223,40): error TS2304: Cannot find name '__webpack_hash__'.
packages/react-dev-utils/webpackHotDevClient.js(228,17): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/webpackHotDevClient.js(233,15): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/webpackHotDevClient.js(261,23): error TS2339: Property 'hot' does not exist on type 'NodeModule'.
packages/react-dev-utils/workspaceUtils.js(11,25): error TS2307: Cannot find module 'find-pkg'.



Standard error:
40 changes: 40 additions & 0 deletions tests/baselines/reference/user/puppeteer.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Exit Code: 1
Standard output:
lib/Coverage.js(109,15): error TS2503: Cannot find namespace 'Protocol'.
lib/Coverage.js(196,15): error TS2503: Cannot find namespace 'Protocol'.
lib/ElementHandle.js(24,15): error TS2503: Cannot find namespace 'Protocol'.
lib/ElementHandle.js(83,29): error TS2503: Cannot find namespace 'Protocol'.
lib/EmulationManager.js(36,16): error TS2503: Cannot find namespace 'Protocol'.
lib/ExecutionContext.js(22,15): error TS2503: Cannot find namespace 'Protocol'.
lib/ExecutionContext.js(132,15): error TS2503: Cannot find namespace 'Protocol'.
lib/FrameManager.js(28,15): error TS2503: Cannot find namespace 'Protocol'.
lib/FrameManager.js(54,15): error TS2503: Cannot find namespace 'Protocol'.
lib/FrameManager.js(76,15): error TS2503: Cannot find namespace 'Protocol'.
lib/FrameManager.js(127,15): error TS2503: Cannot find namespace 'Protocol'.
lib/FrameManager.js(773,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(129,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(174,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(207,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(224,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(256,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(270,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(286,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(313,15): error TS2503: Cannot find namespace 'Protocol'.
lib/NetworkManager.js(640,13): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(66,15): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(185,15): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(394,22): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(407,15): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(731,19): error TS2503: Cannot find namespace 'Protocol'.
lib/externs.d.ts(16,26): error TS2503: Cannot find namespace 'Protocol'.
lib/externs.d.ts(16,69): error TS2503: Cannot find namespace 'Protocol'.
lib/externs.d.ts(17,28): error TS2503: Cannot find namespace 'Protocol'.
lib/externs.d.ts(17,81): error TS2503: Cannot find namespace 'Protocol'.
lib/externs.d.ts(17,121): error TS2503: Cannot find namespace 'Protocol'.
lib/helper.js(59,15): error TS2503: Cannot find namespace 'Protocol'.
lib/helper.js(77,15): error TS2503: Cannot find namespace 'Protocol'.
lib/helper.js(101,15): error TS2503: Cannot find namespace 'Protocol'.



Standard error:
Loading

0 comments on commit db68075

Please sign in to comment.