Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

web-component-tester build broken when used alone #3370

Open AaronNGray opened 5 years ago

AaronNGray commented 5 years ago
C:\Users\aaron\GitHub\web-component-tester>npm run build

> web-component-tester@6.6.0-pre.5 build C:\Users\aaron\GitHub\web-component-tester
> tsc && gulp build

fs.js:25
'use strict';
^

ReferenceError: internalBinding is not defined
    at fs.js:25:1
    at req_ (C:\Users\aaron\GitHub\web-component-tester\node_modules\natives\index.js:137:5)
    at Object.req [as require] (C:\Users\aaron\GitHub\web-component-tester\node_modules\natives\index.js:54:10)
    at Object.<anonymous> (C:\Users\aaron\GitHub\web-component-tester\node_modules\gulp\node_modules\graceful-fs\fs.js:1:99)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web-component-tester@6.6.0-pre.5 build: `tsc && gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web-component-tester@6.6.0-pre.5 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\aaron\AppData\Roaming\npm-cache\_logs\2019-03-04T12_56_26_595Z-debug.log
AaronNGray commented 5 years ago

Created pull request :- https://github.com/Polymer/tools/pull/3371

AaronNGray commented 5 years ago

Still getting typescript errors :-

C:\Users\aaron\GitHub\temp\tools\packages\web-component-tester>npm run build

> web-component-tester@6.9.2 build C:\Users\aaron\GitHub\temp\tools\packages\web-component-tester
> tsc && gulp build

runner/browserrunner.ts:40:3 - error TS2564: Property 'browser' has no initializer and is not definitely assigned in the constructor.

40   browser: wd.Browser;
     ~~~~~~~

runner/browserrunner.ts:42:3 - error TS2564: Property 'sessionId' has no initializer and is not definitely assigned in the constructor.

42   sessionId: string;
     ~~~~~~~~~

runner/browserrunner.ts:43:3 - error TS2564: Property 'timeoutId' has no initializer and is not definitely assigned in the constructor.

43   timeoutId: NodeJS.Timer;
     ~~~~~~~~~

runner/browserrunner.ts:54:11 - error TS2564: Property '_resolve' has no initializer and is not definitely assigned in the constructor.

54   private _resolve: () => void;
             ~~~~~~~~

runner/browserrunner.ts:55:11 - error TS2564: Property '_reject' has no initializer and is not definitely assigned in the constructor.

55   private _reject: (err: any) => void;
             ~~~~~~~

runner/browserrunner.ts:75:5 - error TS2322: Type 'number | undefined' is not assignable to type 'number'.
  Type 'undefined' is not assignable to type 'number'.

75     this.timeout = options.testTimeout;
       ~~~~~~~~~~~~

runner/browserrunner.ts:227:5 - error TS2322: Type 'null' is not assignable to type 'Browser'.

227     this.browser = null;
        ~~~~~~~~~~~~

runner/browserrunner.ts:230:19 - error TS2532: Object is possibly 'undefined'.

230     if (!error && this.stats.failing > 0) {
                      ~~~~~~~~~~~~~~~~~~

runner/clireporter.ts:85:11 - error TS2564: Property 'linesWritten' has no initializer and is not definitely assigned in the constructor.

85   private linesWritten: number;
             ~~~~~~~~~~~~

runner/clireporter.ts:177:11 - error TS2532: Object is possibly 'undefined'.

177       if (counts[0] > 0 || counts[1] > 0 || counts[2] > 0) {
              ~~~~~~~~~

runner/clireporter.ts:177:28 - error TS2532: Object is possibly 'undefined'.

177       if (counts[0] > 0 || counts[1] > 0 || counts[2] > 0) {
                               ~~~~~~~~~

runner/clireporter.ts:177:45 - error TS2532: Object is possibly 'undefined'.

177       if (counts[0] > 0 || counts[1] > 0 || counts[2] > 0) {
                                                ~~~~~~~~~

runner/clireporter.ts:178:13 - error TS2532: Object is possibly 'undefined'.

178         if (counts[0] > 0) {
                ~~~~~~~~~

runner/clireporter.ts:179:40 - error TS2532: Object is possibly 'undefined'.

179           counts[0] = <any>chalk.green(counts[0].toString());
                                           ~~~~~~~~~

runner/clireporter.ts:181:13 - error TS2532: Object is possibly 'undefined'.

181         if (counts[1] > 0) {
                ~~~~~~~~~

runner/clireporter.ts:182:41 - error TS2532: Object is possibly 'undefined'.

182           counts[1] = <any>chalk.yellow(counts[1].toString());
                                            ~~~~~~~~~

runner/clireporter.ts:184:13 - error TS2532: Object is possibly 'undefined'.

184         if (counts[2] > 0) {
                ~~~~~~~~~

runner/clireporter.ts:185:38 - error TS2532: Object is possibly 'undefined'.

185           counts[2] = <any>chalk.red(counts[2].toString());
                                         ~~~~~~~~~

runner/clireporter.ts:274:9 - error TS2454: Variable 'format' is used before being assigned.

274     if (format) {
            ~~~~~~

runner/config.ts:30:5 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

30     process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

runner/config.ts:31:7 - error TS6133: 'JSON_MATCHER' is declared but its value is never read.

31 const JSON_MATCHER = 'wct.conf.json';
         ~~~~~~~~~~~~

runner/config.ts:32:7 - error TS6133: 'CONFIG_MATCHER' is declared but its value is never read.

32 const CONFIG_MATCHER = 'wct.conf.*';
         ~~~~~~~~~~~~~~

runner/config.ts:127:34 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

127   const basename = path.basename(options.root);
                                     ~~~~~~~~~~~~

runner/config.ts:136:10 - error TS6133: 'resolvePackageDir' is declared but its value is never read.

136 function resolvePackageDir(
             ~~~~~~~~~~~~~~~~~

runner/config.ts:225:5 - error TS2322: Type '{ port: undefined; hostname: string; }' is not assignable to type '{ port: number; hostname: string; _generatedIndexContent?: string | undefined; _servers?: { variant: string; url: string; }[] | undefined; }'.
  Types of property 'port' are incompatible.
    Type 'undefined' is not assignable to type 'number'.

225     webserver: {
        ~~~~~~~~~

  runner/config.ts:55:3
    55   webserver?: {
         ~~~~~~~~~
    The expected type comes from property 'webserver' which is declared here on type 'Config'

runner/config.ts:467:10 - error TS2532: Object is possibly 'undefined'.

467     if (!config['full']) {
             ~~~~~~

runner/config.ts:468:7 - error TS2532: Object is possibly 'undefined'.

468       config['full'] = key;
          ~~~~~~

runner/config.ts:484:12 - error TS2538: Type 'undefined' cannot be used as an index type.

484     target[_.last(parts)] = value;
               ~~~~~~~~~~~~~

runner/config.ts:505:9 - error TS2532: Object is possibly 'undefined'.

505         result.plugins[key] = false;
            ~~~~~~~~~~~~~~

runner/config.ts:548:45 - error TS2345: Argument of type 'string[] | undefined' is not assignable to parameter of type 'string[]'.
  Type 'undefined' is not assignable to type 'string[]'.

548   options.suites = await paths.expand(root, options.suites);
                                                ~~~~~~~~~~~~~~

runner/config.ts:582:7 - error TS2532: Object is possibly 'undefined'.

582       fragment.plugins[plugin].browsers.push(browser);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

runner/config.ts:633:7 - error TS2532: Object is possibly 'undefined'.

633   if (options.activeBrowsers.length === 0) {
          ~~~~~~~~~~~~~~~~~~~~~~

runner/config.ts:636:7 - error TS2532: Object is possibly 'undefined'.

636   if (options.suites.length === 0) {
          ~~~~~~~~~~~~~~

runner/config.ts:638:19 - error TS2532: Object is possibly 'undefined'.

638     const globs = options.origSuites.join(', ');
                      ~~~~~~~~~~~~~~~~~~

runner/context.ts:18:9 - error TS6133: 'ExpressAppMapper' is declared but its value is never read.

18 import {ExpressAppMapper, ServerOptions} from 'polyserve/lib/start_server';
           ~~~~~~~~~~~~~~~~

runner/context.ts:19:1 - error TS6133: 'socketIO' is declared but its value is never read.

19 import * as socketIO from 'socket.io';
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

runner/context.ts:21:1 - error TS6133: 'util' is declared but its value is never read.

21 import * as util from 'util';
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

runner/context.ts:50:3 - error TS2564: Property '_socketIOServers' has no initializer and is not definitely assigned in the constructor.

50   _socketIOServers: SocketIO.Server[];
     ~~~~~~~~~~~~~~~~

runner/context.ts:51:3 - error TS2564: Property '_httpServers' has no initializer and is not definitely assigned in the constructor.

51   _httpServers: http.Server[];
     ~~~~~~~~~~~~

runner/context.ts:52:3 - error TS2564: Property '_testRunners' has no initializer and is not definitely assigned in the constructor.

52   _testRunners: BrowserRunner[];
     ~~~~~~~~~~~~

runner/context.ts:220:12 - error TS2532: Object is possibly 'undefined'.

220     return this.options.plugins[Plugin.shortName(name)];
               ~~~~~~~~~~~~~~~~~~~~

runner/steps.ts:121:29 - error TS2532: Object is possibly 'undefined'.

121   const numActiveBrowsers = options.activeBrowsers.length;
                                ~~~~~~~~~~~~~~~~~~~~~~

runner/steps.ts:141:36 - error TS2532: Object is possibly 'undefined'.

141   for (const originalBrowserDef of options.activeBrowsers) {
                                       ~~~~~~~~~~~~~~~~~~~~~~

runner/steps.ts:143:26 - error TS2532: Object is possibly 'undefined'.

143     for (const server of options.webserver._servers) {
                             ~~~~~~~~~~~~~~~~~

runner/steps.ts:143:26 - error TS2532: Object is possibly 'undefined'.

143     for (const server of options.webserver._servers) {
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~

runner/steps.ts:150:13 - error TS7022: 'runner' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

150       const runner =
                ~~~~~~

runner/steps.ts:156:12 - error TS7006: Parameter 'error' implicitly has an 'any' type.

156           (error) => {
               ~~~~~

runner/webserver.ts:69:7 - error TS2532: Object is possibly 'undefined'.

69       options.clientOptions.verbose = true;
         ~~~~~~~~~~~~~~~~~~~~~

runner/webserver.ts:74:22 - error TS2532: Object is possibly 'undefined'.

74     options.suites = options.suites.map((cv) => cv.replace(/\\/g, '/'));
                        ~~~~~~~~~~~~~~

runner/webserver.ts:81:35 - error TS6133: 'extraScripts' is declared but its value is never read.

81     const scripts: string[] = [], extraScripts: string[] = [];
                                     ~~~~~~~~~~~~

runner/webserver.ts:82:35 - error TS6133: 'extraModules' is declared but its value is never read.

82     const modules: string[] = [], extraModules: string[] = [];
                                     ~~~~~~~~~~~~

runner/webserver.ts:102:17 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

102                 options.wctPackageName) ?
                    ~~~~~~~~~~~~~~~~~~~~~~

runner/webserver.ts:106:41 - error TS2532: Object is possibly 'undefined'.

106             npmPackageRootPath.length - options.wctPackageName.length);
                                            ~~~~~~~~~~~~~~~~~~~~~~

runner/webserver.ts:113:34 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

113           path.resolve(path.join(options.root, 'node_modules'));
                                     ~~~~~~~~~~~~

runner/webserver.ts:121:15 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

121               options.wctPackageName)) {
                  ~~~~~~~~~~~~~~~~~~~~~~

runner/webserver.ts:181:39 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

181       componentDir = bowerConfig.read(options.root).directory;
                                          ~~~~~~~~~~~~

runner/webserver.ts:183:21 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

183           path.join(options.root, componentDir, 'web-component-tester');
                        ~~~~~~~~~~~~

runner/webserver.ts:248:21 - error TS2532: Object is possibly 'undefined'.

248       response.send(options.webserver._generatedIndexContent);
                        ~~~~~~~~~~~~~~~~~

runner/webserver.ts:268:21 - error TS2532: Object is possibly 'undefined'.

268           hostname: options.webserver.hostname,
                        ~~~~~~~~~~~~~~~~~

runner/webserver.ts:269:17 - error TS2532: Object is possibly 'undefined'.

269           port: options.webserver.port,
                    ~~~~~~~~~~~~~~~~~

runner/webserver.ts:297:9 - error TS2532: Object is possibly 'undefined'.

297         wsOptions.port = address.port;
            ~~~~~~~~~

runner/webserver.ts:297:26 - error TS2531: Object is possibly 'null'.

297         wsOptions.port = address.port;
                             ~~~~~~~

runner/webserver.ts:304:9 - error TS2532: Object is possibly 'undefined'.

304         wsOptions.port = address.port;
            ~~~~~~~~~

runner/webserver.ts:304:26 - error TS2531: Object is possibly 'null'.

304         wsOptions.port = address.port;
                             ~~~~~~~

runner/webserver.ts:324:5 - error TS2532: Object is possibly 'undefined'.

324     options.webserver._servers = servers.map((s) => {
        ~~~~~~~~~~~~~~~~~

runner/webserver.ts:326:59 - error TS2531: Object is possibly 'null'.

326       const port = typeof address === 'string' ? '' : `:${address.port}`;
                                                              ~~~~~~~

runner/webserver.ts:363:10 - error TS6133: 'exists' is declared but its value is never read.

363 function exists(path: string): boolean {
             ~~~~~~

test/integration/browser.ts:20:9 - error TS6133: 'ExpressAppMapper' is declared but its value is never read.

20 import {ExpressAppMapper, ServerOptions} from 'polyserve/lib/start_server';
           ~~~~~~~~~~~~~~~~

test/integration/browser.ts:90:3 - error TS2411: Property 'state' of type '"passing" | "failing" | "pending" | "unknown" | undefined' is not assignable to string index type '"passing" | "failing" | "pending" | "unknown" | TestNode'.

90   state?: CompletedState; [subTestName: string]: TestNode | CompletedState;
     ~~~~~

test/integration/browser.ts:129:37 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.

129     const config = suitesToOnly.has(fn) ?
                                        ~~

test/integration/browser.ts:291:11 - error TS2532: Object is possibly 'undefined'.

291       if (this.currentTest.state === 'failed') {
              ~~~~~~~~~~~~~~~~

test/integration/browser.ts:334:10 - error TS6133: 'assertPassed' is declared but its value is never read.

334 function assertPassed(context: TestResults) {
             ~~~~~~~~~~~~

test/integration/browser.ts:349:10 - error TS6133: 'assertFailed' is declared but its value is never read.

349 function assertFailed(context: VariantResults, expectedError: string) {
             ~~~~~~~~~~~~

test/integration/browser.ts:394:28 - error TS2532: Object is possibly 'undefined'.

394         const stackLines = error.stack.split('\n');
                               ~~~~~~~~~~~

test/retry-failures-reporter.ts:18:33 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

18 const retryTargetMax = parseInt(process.env['TEST_RETRY_TARGET_MAX'], 10) || 0;
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

test/retry-failures-reporter.ts:19:29 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

19 const retryCount = parseInt(process.env['TEST_RETRY_COUNT'], 10) || 0;
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

test/retry-failures-reporter.ts:20:27 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

20 const retryMax = parseInt(process.env['TEST_RETRY_MAX'], 10) || 3;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

test/retry-failures-reporter.ts:150:30 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

150     const array = JSON.parse(json);
                                 ~~~~

test/unit/cli.ts:75:14 - error TS2454: Variable 'output' is used before being assigned.

75       expect(output).to.eq(`${version}\n`);
                ~~~~~~

test/unit/cli.ts:77:14 - error TS2454: Variable 'output' is used before being assigned.

77       expect(output).to.eq(`${version}\n`);
                ~~~~~~

test/unit/cli.ts:200:16 - error TS2532: Object is possibly 'undefined'.

200         expect(options.plugins['sauce'].username).to.eq('abc123');
                   ~~~~~~~~~~~~~~~

test/unit/cli.ts:235:15 - error TS2532: Object is possibly 'undefined'.

235               options.activeBrowsers.map((browser) => browser.browserName);
                  ~~~~~~~~~~~~~~~~~~~~~~

test/unit/cli.ts:245:15 - error TS2532: Object is possibly 'undefined'.

245               options.activeBrowsers.map((browser) => browser.browserName);
                  ~~~~~~~~~~~~~~~~~~~~~~

test/unit/cli.ts:264:15 - error TS2532: Object is possibly 'undefined'.

264               options.activeBrowsers.map((browser) => browser.platform);
                  ~~~~~~~~~~~~~~~~~~~~~~

test/unit/config.ts:15:1 - error TS6133: 'path' is declared but its value is never read.

15 import * as path from 'path';
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

test/unit/config.ts:50:18 - error TS2532: Object is possibly 'undefined'.

50           expect(context.options.plugins['local'].browsers).to.have.members([
                    ~~~~~~~~~~~~~~~~~~~~~~~

test/unit/config.ts:59:18 - error TS2532: Object is possibly 'undefined'.

59           expect(context.options.plugins['sauce'].browsers).to.have.members([
                    ~~~~~~~~~~~~~~~~~~~~~~~

test/unit/config.ts:69:18 - error TS2532: Object is possibly 'undefined'.

69           expect(context.options.plugins['local'].browsers)
                    ~~~~~~~~~~~~~~~~~~~~~~~

test/unit/config.ts:79:18 - error TS2532: Object is possibly 'undefined'.

79           expect(context.options.plugins['sauce'].browsers)
                    ~~~~~~~~~~~~~~~~~~~~~~~

test/unit/gulp.ts:49:30 - error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.

49           pluginsCalled.push(this.name);
                                ~~~~

  test/unit/gulp.ts:48:20
    48         .callsFake(async function(context: Context) {
                          ~~~~~
    An outer value of 'this' is shadowed by this container.

test/unit/gulp.ts:50:11 - error TS2532: Object is possibly 'undefined'.

50           context.options.activeBrowsers.push(
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

test/unit/gulp.ts:51:48 - error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.

51               <any>{browserName: 'fake for ' + this.name});
                                                  ~~~~

  test/unit/gulp.ts:48:20
    48         .callsFake(async function(context: Context) {
                          ~~~~~
    An outer value of 'this' is shadowed by this container.

test/unit/gulp.ts:68:12 - error TS2532: Object is possibly 'undefined'.

68     expect(options.plugins['sauce'].username).to.eq('abc123');
              ~~~~~~~~~~~~~~~

test/unit/gulp.ts:74:12 - error TS2532: Object is possibly 'undefined'.

74     expect(options.plugins['sauce'].username).to.eq('jsonconf');
              ~~~~~~~~~~~~~~~

Found 94 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! web-component-tester@6.9.2 build: `tsc && gulp build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the web-component-tester@6.9.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\aaron\AppData\Roaming\npm-cache\_logs\2019-03-04T12_47_47_775Z-debug.log
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.