wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
760 stars 45 forks source link

Need help fixing Zone is not defined #2326

Closed Dethlore closed 4 years ago

Dethlore commented 4 years ago

Starting wallaby gives the error:

[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846 
[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846 
[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846 
[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846 
[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846 
[Error] Runtime error: Uncaught ReferenceError: Zone is not defined 
[Error] at http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846

Wallaby Diagnostics Report:

{ editorVersion: '1.35.1',
  pluginVersion: '1.0.171',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.16299',
  nodeVersion: 'v10.15.3',
  coreVersion: '1.0.825',
  config:
   { files:
      [ { pattern: '**/*.min.js', ignore: true, trigger: true, load: true, instrument: true },
        { pattern: 'wallaby.js', load: false, instrument: false, ignore: false, trigger: true, order: 1 },
        { pattern: 'projects/mis-planner/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 1 },
        { pattern: 'projects/mis-planner/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
        { pattern: 'projects/mis-soc-interface/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
        { pattern: 'projects/mis-spacecraft-manager/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
        { pattern: 'node_modules/cesium/Build/Cesium/Widgets/widgets.css', instrument: false, ignore: false, trigger: true, load: true, order: 13 },
        { pattern: 'node_modules/cesium/Build/Cesium/Cesium.js', instrument: false, ignore: false, trigger: true, load: true, order: 14 } ],
     tests:
      [ { pattern: 'projects/mis-planner/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 23 } ],
     testFramework: { version: 'jasmine@3.4.0', configurator: 'jasmine@2.1.3', reporter: 'jasmine@2.1.3', starter: 'jasmine@2.1.3' },
     compilers: { '**/*.?(lit)coffee?(.md)': [Function] },
     preprocessors: { 'wallaby.js': [Function: wallaby.js] },
     env: { kind: 'chrome', type: 'browser', params: {}, viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
     diagnostics: {},
     filesWithNoCoverageCalculated: [],
     runAllTestsInAffectedTestFile: false,
     maxConsoleMessagesPerTest: 100,
     autoConsoleLog: true,
     delays: { run: 0, edit: 100, update: 0 },
     workers: { initial: 0, regular: 0, recycle: false },
     teardown: undefined,
     hints:
      { ignoreCoverage: '__REGEXP /ignore coverage|istanbul ignore/',
        ignoreCoverageForFile: '__REGEXP /ignore file coverage/',
        commentAutoLog: '?',
        testFileSelection: { include: '__REGEXP /file\\.only/', exclude: '__REGEXP /file\\.skip/' } },
     automaticTestFileSelection: true,
     runSelectedTestsOnly: false,
     extensions: {},
     reportUnhandledPromises: false,
     throwOnBeforeUnload: true,
     slowTestThreshold: 75,
     lowCoverageThreshold: 80,
     loose: undefined,
     configCode:
      '// Wallaby config is done better here: https://wallabyjs.com/docs/tutorial/angular-cli.html\n// mtk-ui currently causes problems with that method\n\nmodule.exports = function(wallaby) {\n  const wallabyWebpack = require(\'wallaby-webpack\');\n  const path = require(\'path\');\n  const fs = require(\'fs\');\n\n  const specPattern = \'/**/*spec.ts\';\n  const angularConfig = require(\'./angular.json\');\n\n  const projects = Object.keys(angularConfig.projects)\n    .map(key => {\n      return { name: key, ...angularConfig.projects[key] };\n    })\n    .filter(project => project.sourceRoot)\n    .filter(\n      project =>\n        project.projectType !== \'application\' ||\n        (project.architect &&\n          project.architect.test &&\n          project.architect.test.builder === \'@angular-devkit/build-angular:karma\')\n    );\n\n  const applications = projects.filter(project => project.projectType === \'application\');\n  const libraries = projects.filter(project => project.projectType === \'library\');\n\n  const tsConfigFile = projects\n    .map(project => path.join(__dirname, project.root, \'tsconfig.spec.json\'))\n    .find(tsConfig => fs.existsSync(tsConfig));\n\n  const tsConfigSpec = tsConfigFile ? JSON.parse(fs.readFileSync(tsConfigFile)) : {};\n\n  const compilerOptions = Object.assign(\n    require(\'./tsconfig.json\').compilerOptions,\n    tsConfigSpec.compilerOptions\n  );\n  compilerOptions.emitDecoratorMetadata = true;\n\n  return {\n    files: [\n      \'!**/*.min.js\',\n      { pattern: path.basename(__filename), load: false, instrument: false },\n      ...projects.map(project => ({\n        pattern: project.sourceRoot + \'/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)\',\n        load: false\n      })),\n      ...projects.map(project => ({\n        pattern: project.sourceRoot + specPattern,\n        ignore: true\n      })),\n      ...projects.map(project => ({\n        pattern: project.sourceRoot + \'/**/*.d.ts\',\n        ignore: true\n      })),\n      {\n        pattern: \'node_modules/cesium/Build/Cesium/Widgets/widgets.css\',\n        instrument: false\n      },\n      {\n        pattern: \'node_modules/cesium/Build/Cesium/Cesium.js\',\n        instrument: false\n      }\n    ],\n\n    tests: [\n      ...projects.map(project => ({\n        pattern: project.sourceRoot + specPattern,\n        load: false\n      }))\n    ],\n\n    testFramework: \'jasmine\',\n\n    compilers: {\n      \'**/*.ts\': wallaby.compilers.typeScript({\n        ...compilerOptions,\n        getCustomTransformers: program => {\n          return {\n            before: [\n              require(\'@ngtools/webpack/src/transformers/replace_resources\').replaceResources(\n                path => true,\n                () => program.getTypeChecker(),\n                false\n              )\n            ]\n          };\n        }\n      })\n    },\n\n    preprocessors: {\n      /* Initialize Test Environment for Wallaby */\n      [path.basename(__filename)]: file => `\n            import \'@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills\';\n            import \'zone.js/dist/zone-testing\';\n            import { getTestBed } from \'@angular/core/testing\';\n            import { BrowserDynamicTestingModule,  platformBrowserDynamicTesting} from \'@angular/platform-browser-dynamic/testing\';\n            window[\'CESIUM_BASE_URL\'] = \'/assets/cesium/\';\n            getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());\n            `\n    },\n\n    middleware: function(app, express) {\n      const path = require(\'path\');\n\n      applications.forEach(application => {\n        if (\n          !application.architect ||\n          !application.architect.test ||\n          !application.architect.test.options ||\n          !application.architect.test.options.assets\n        ) {\n          return;\n        }\n\n        application.architect.test.options.assets.forEach(asset => {\n          if (typeof asset === \'string\') {\n            app.use(asset.slice(application.sourceRoot.length), express.static(path.join(__dirname, asset)));\n          } else {\n            app.use(asset.output, express.static(path.join(__dirname, asset.input)));\n          }\n        });\n      });\n    },\n\n    env: {\n      kind: \'chrome\'\n    },\n\n    postprocessor: wallabyWebpack({\n      entryPatterns: [\n        ...applications\n          .map(project => project.sourceRoot + \'/polyfills.js\')\n          .filter(polyfills => fs.existsSync(path.join(__dirname, polyfills.replace(/js$/, \'ts\')))),\n        path.basename(__filename),\n        ...projects.map(project => project.sourceRoot + specPattern.replace(/ts$/, \'js\'))\n      ],\n\n      module: {\n        rules: [\n          { test: /\\.css$/, loader: [\'raw-loader\'] },\n          { test: /\\.html$/, loader: \'raw-loader\' },\n          {\n            test: /\\.ts$/,\n            loader: \'@ngtools/webpack\',\n            include: /node_modules/,\n            query: { tsConfigPath: \'tsconfig.json\' }\n          },\n          { test: /\\.styl$/, loaders: [\'raw-loader\', \'stylus-loader\'] },\n          { test: /\\.less$/, loaders: [\'raw-loader\', { loader: \'less-loader\' }] },\n          {\n            test: /\\.scss$|\\.sass$/,\n            loaders: [\n              { loader: \'raw-loader\' },\n              { loader: \'sass-loader\', options: { implementation: require(\'sass\') } }\n            ]\n          },\n          { test: /\\.(jpg|png|svg)$/, loader: \'raw-loader\' }\n        ]\n      },\n\n      resolve: {\n        extensions: [\'.js\', \'.ts\'],\n        modules: [\n          wallaby.projectCacheDir,\n          ...(projects.length\n            ? projects\n                .filter(project => project.root)\n                .map(project => path.join(wallaby.projectCacheDir, project.root))\n            : []),\n          ...(projects.length\n            ? projects\n                .filter(project => project.sourceRoot)\n                .map(project => path.join(wallaby.projectCacheDir, project.sourceRoot))\n            : []),\n          \'node_modules\'\n        ],\n        alias: libraries.reduce((result, project) => {\n          result[project.name] = path.join(wallaby.projectCacheDir, project.sourceRoot, \'public-api\');\n          return result;\n        }, {})\n      }\n    }),\n\n    setup: function() {\n      window.__moduleBundler.loadTests();\n    }\n  };\n};\n' },
  packageJSON:
   { dependencies:
      { '@angular/animations': '7.2.15',
        '@angular/cdk': '^7.3.7',
        '@angular/cli': '7.3.9',
        '@angular/common': '7.2.15',
        '@angular/compiler': '7.2.15',
        '@angular/core': '7.2.15',
        '@angular/forms': '7.2.15',
        '@angular/platform-browser': '7.2.15',
        '@angular/platform-browser-dynamic': '7.2.15',
        '@angular/router': '7.2.15',
        '@auth0/angular-jwt': '2.1.0',
        '@fullcalendar/angular': '^4.2.1',
        '@fullcalendar/core': '^4.2.0',
        '@fullcalendar/daygrid': '^4.2.0',
        '@fullcalendar/interaction': '^4.2.0',
        '@fullcalendar/list': '^4.2.0',
        '@fullcalendar/timegrid': '^4.2.0',
        '@linnenschmidt/build-ng-packagr': '^7.0.2',
        '@turf/turf': '5.1.6',
        acorn: '^6.2.1',
        ajv: '^6.9.1',
        'angular-cesium': '0.0.60',
        'angular-plotly.js': '1.3.2',
        cesium: '^1.62.0',
        codemirror: '5.42.2',
        'core-js': '^2.5.4',
        'file-saver': '1.3.3',
        'font-awesome': '^4.7.0',
        'mtk-gojs': 'file:plugins/mtk-gojs.tgz',
        'mtk-ui': 'file:plugins/mtk-ui.tgz',
        'ng2-codemirror': '1.1.3',
        path: '^0.12.7',
        'plotly.js': '^1.48.3',
        primeicons: '1.0.0',
        primeng: '7.1.3',
        rxjs: '^6.5.2',
        'sass-loader': '^7.1.0',
        satellite: '^0.0.2',
        'satellite.js': '1.3.0',
        tslib: '^1.9.0',
        'url-search-params-polyfill': '^6.0.0',
        'zone.js': '~0.8.26' },
     devDependencies:
      { '@angular-devkit/build-angular': '0.13.9',
        '@angular-devkit/build-ng-packagr': '0.13.9',
        '@angular/compiler-cli': '7.2.15',
        '@angular/language-service': '7.2.15',
        '@types/cesium': '^1.59.0',
        '@types/geodesy': '^1.1.2',
        '@types/jasmine': '~2.8.8',
        '@types/jasminewd2': '~2.0.3',
        '@types/node': '~8.9.4',
        '@types/plotly.js': '^1.44.6',
        '@types/webpack-env': '^1.14.0',
        'angular2-template-loader': '^0.6.2',
        angular2parse: '^1.0.8',
        codelyzer: '~4.5.0',
        geodesy: '^1.1.1',
        jasmine: '2.7.0',
        'jasmine-core': '~2.99.1',
        'jasmine-spec-reporter': '~4.2.1',
        karma: '~4.0.0',
        'karma-chrome-launcher': '~2.2.0',
        'karma-cli': '^2.0.0',
        'karma-coverage-istanbul-reporter': '~2.0.1',
        'karma-htmlfile-reporter': '^0.3.8',
        'karma-intl-shim': '^1.0.3',
        'karma-jasmine': '~1.1.2',
        'karma-jasmine-html-reporter': '^0.2.2',
        'karma-junit-reporter': '^1.2.0',
        'karma-phantomjs-launcher': '^1.0.4',
        'karma-typescript': '^4.0.0',
        'lite-server': '^2.5.3',
        'ng-mocks': '^7.8.0',
        'ng-packagr': '^4.2.0',
        'ngx-build-plus': '^7.7.6',
        protractor: '~5.4.0',
        rimraf: '^2.6.3',
        sass: '^1.23.7',
        'sdl-tslint-rules': '^1.0.0',
        'shebang-command': '^1.2.0',
        'shebang-loader': '^0.0.1',
        'shebang-regex': '^2.0.0',
        'ts-node': '~7.0.0',
        tsickle: '0.34.0',
        tslint: '~5.17.0',
        typescript: '3.2.4',
        'wallaby-webpack': '*',
        webpack: '^4.34.0' } },
  fs: { numberOfFiles: 1044 },
  debug:
   [ '2020-02-05T23:21:47.029Z project Wallaby Node version: v10.15.3\n',
     '2020-02-05T23:21:47.029Z project Wallaby config: C:\\dev\\repos\\mission\\WebApplications\\wallaby.js\n',
     '2020-02-05T23:21:49.430Z project File cache: C:\\Users\\rperry\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.171\\projects\\fbcb4e2d071ee80b\n',
     '2020-02-05T23:21:49.485Z uiService Listening port 51235\n',
     '2020-02-05T23:21:49.694Z workers Parallelism for initial run: 6, for regular run: 3\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #0\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #1\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #2\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #3\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #4\n',
     '2020-02-05T23:21:49.694Z workers Starting run worker instance #5\n',
     '2020-02-05T23:21:49.726Z workers Web server is listening at 55496\n',
     '2020-02-05T23:21:49.952Z project File cache requires some updates, waiting required files from IDE\n',
     '2020-02-05T23:21:51.275Z workers Started run worker instance (immediate) #0\n',
     '2020-02-05T23:21:51.275Z workers Started run worker instance (immediate) #1\n',
     '2020-02-05T23:21:51.276Z workers Started run worker instance (immediate) #2\n',
     '2020-02-05T23:21:51.276Z workers Started run worker instance (immediate) #3\n',
     '2020-02-05T23:21:51.276Z workers Started run worker instance (immediate) #4\n',
     '2020-02-05T23:21:51.276Z workers Started run worker instance (immediate) #5\n',
     '2020-02-05T23:21:51.432Z project Stopping process pool\n',
     '2020-02-05T23:21:51.436Z project Running postprocessor\n',
     '2020-02-05T23:21:51.488Z postprocessor New TypeScript language service is required\n',
     '2020-02-05T23:22:09.471Z uiService UI client connected\n',
     '2020-02-05T23:22:09.471Z uiService Outgoing message ui:handshake\n',
     '2020-02-05T23:22:09.473Z uiService UI client connected\n',
     '2020-02-05T23:22:09.473Z uiService Outgoing message ui:handshake\n',
     '2020-02-05T23:22:09.478Z uiService UI client disconnected\n',
     '2020-02-05T23:22:09.479Z uiService UI client disconnected\n',
     '2020-02-05T23:22:10.097Z postprocessor New compiler created\n',
     '2020-02-05T23:22:10.353Z postprocessor Webpack compilation started\n',
     '2020-02-05T23:22:16.702Z uiService UI client connected\n',
     '2020-02-05T23:22:16.702Z uiService Outgoing message ui:handshake\n',
     '2020-02-05T23:22:16.750Z uiService Incoming message ui:tests:resultsRequested\n',
     '2020-02-05T23:22:16.751Z uiService Outgoing message ui:tests:allResultsUpdated\n',
     '2020-02-05T23:22:16.771Z uiService Incoming message ui:start\n',
     '2020-02-05T23:22:16.773Z uiService Outgoing message ui:summary\n',
     '2020-02-05T23:22:16.781Z uiService Outgoing message ui:files\n',
     '2020-02-05T23:23:28.147Z postprocessor Webpack compilation finished\n',
     '2020-02-05T23:23:29.309Z postprocessor Emitting 2615 files\n',
     '2020-02-05T23:23:29.996Z project Postprocessor execution finished\n',
     '2020-02-05T23:23:29.996Z project Test run started; run priority: 3\n',
     '2020-02-05T23:23:29.997Z project Running all tests\n',
     '2020-02-05T23:23:30.070Z workers Starting test run, priority: 3\n',
     '2020-02-05T23:23:30.070Z workers Distributing tests between 6 workers\n',
     '2020-02-05T23:23:30.072Z workers Running tests in parallel\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #0, session #oi181]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #1, session #0guut]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #2, session #eac07]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #3, session #jn844]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #4, session #we95w]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Starting sandbox [worker #5, session #puu6c]\n',
     '2020-02-05T23:23:30.072Z chromeRunner Preparing sandbox [worker #0, session #oi181]\n',
     '2020-02-05T23:23:30.075Z browserRunner Total files to load in sandbox: 23\n',
     '2020-02-05T23:23:30.080Z browserRunner Sandbox is generated [worker #0, session #oi181]: http://localhost:55496/wallaby_sandbox0.html\n',
     '2020-02-05T23:23:30.080Z chromeRunner Preparing sandbox [worker #1, session #0guut]\n',
     '2020-02-05T23:23:30.082Z browserRunner Total files to load in sandbox: 22\n',
     '2020-02-05T23:23:30.085Z browserRunner Sandbox is generated [worker #1, session #0guut]: http://localhost:55496/wallaby_sandbox1.html\n',
     '2020-02-05T23:23:30.085Z chromeRunner Preparing sandbox [worker #2, session #eac07]\n',
     '2020-02-05T23:23:30.086Z browserRunner Total files to load in sandbox: 23\n',
     '2020-02-05T23:23:30.090Z browserRunner Sandbox is generated [worker #2, session #eac07]: http://localhost:55496/wallaby_sandbox2.html\n',
     '2020-02-05T23:23:30.090Z chromeRunner Preparing sandbox [worker #3, session #jn844]\n',
     '2020-02-05T23:23:30.091Z browserRunner Total files to load in sandbox: 23\n',
     '2020-02-05T23:23:30.094Z browserRunner Sandbox is generated [worker #3, session #jn844]: http://localhost:55496/wallaby_sandbox3.html\n',
     '2020-02-05T23:23:30.094Z chromeRunner Preparing sandbox [worker #4, session #we95w]\n',
     '2020-02-05T23:23:30.095Z browserRunner Total files to load in sandbox: 23\n',
     '2020-02-05T23:23:30.098Z browserRunner Sandbox is generated [worker #4, session #we95w]: http://localhost:55496/wallaby_sandbox4.html\n',
     '2020-02-05T23:23:30.098Z chromeRunner Preparing sandbox [worker #5, session #puu6c]\n',
     '2020-02-05T23:23:30.099Z browserRunner Total files to load in sandbox: 23\n',
     '2020-02-05T23:23:30.102Z browserRunner Sandbox is generated [worker #5, session #puu6c]: http://localhost:55496/wallaby_sandbox5.html\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #0, session #oi181]\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #1, session #0guut]\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #2, session #eac07]\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #3, session #jn844]\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #4, session #we95w]\n',
     '2020-02-05T23:23:30.102Z chromeRunner Prepared sandbox [worker #5, session #puu6c]\n',
     '2020-02-05T23:23:30.102Z workers [worker #0, session #oi181] Running tests in sandbox\n',
     '2020-02-05T23:23:30.103Z workers [worker #1, session #0guut] Running tests in sandbox\n',
     '2020-02-05T23:23:30.104Z workers [worker #2, session #eac07] Running tests in sandbox\n',
     '2020-02-05T23:23:30.104Z workers [worker #3, session #jn844] Running tests in sandbox\n',
     '2020-02-05T23:23:30.104Z workers [worker #4, session #we95w] Running tests in sandbox\n',
     '2020-02-05T23:23:30.104Z workers [worker #5, session #puu6c] Running tests in sandbox\n',
     '2020-02-05T23:23:33.249Z workers Sandbox (active) [oi181] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:33.251Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:33.352Z workers [oi181] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.151Z workers [oi181] Sandbox is responsive, closing it\n',
     '2020-02-05T23:23:34.154Z workers Sandbox (active) [0guut] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:34.155Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:34.160Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read property \'Runtime\' of undefined\n',
     '2020-02-05T23:23:34.228Z workers Sandbox (active) [eac07] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:34.228Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:34.256Z workers [0guut] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.273Z workers Sandbox (active) [jn844] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:34.273Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:34.298Z workers Sandbox (active) [we95w] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:34.298Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:34.299Z workers Sandbox (active) [puu6c] error: Uncaught ReferenceError: Zone is not defined\n',
     '2020-02-05T23:23:34.299Z workers Failed to map the stack to user code, entry message: Uncaught ReferenceError: Zone is not defined, stack: Uncaught ReferenceError: Zone is not defined\nat http://localhost:55496/____wallaby-bundle.js?1580945009556&wallabyFileId=bundle:428846\n',
     '2020-02-05T23:23:34.328Z workers [eac07] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.374Z workers [jn844] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.398Z workers [we95w] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.400Z workers [puu6c] Run 0 test(s), skipped 0 test(s)\n',
     '2020-02-05T23:23:34.933Z workers [jn844] Sandbox is responsive, closing it\n',
     '2020-02-05T23:23:34.939Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read property \'Runtime\' of undefined\n',
     '2020-02-05T23:23:35.047Z workers [eac07] Sandbox is responsive, closing it\n',
     '2020-02-05T23:23:35.108Z workers [we95w] Sandbox is responsive, closing it\n',
     '2020-02-05T23:23:35.124Z workers [puu6c] Sandbox is responsive, closing it\n',
     '2020-02-05T23:23:35.257Z workers [0guut] Sandbox is not responsive, recycling worker instance\n',
     '2020-02-05T23:23:35.258Z workers Merging parallel test run results\n',
     '2020-02-05T23:23:35.258Z project Test run finished\n',
     '2020-02-05T23:23:35.258Z project Processed console.log entries\n',
     '2020-02-05T23:23:35.258Z project Processed loading sequences\n',
     '2020-02-05T23:23:35.259Z project Processed executed tests\n',
     '2020-02-05T23:23:35.313Z project Processed code coverage\n',
     '2020-02-05T23:23:35.474Z project Test run result processed and sent to IDE\n',
     '2020-02-05T23:23:35.475Z uiService Outgoing message ui:summary\n',
     '2020-02-05T23:23:35.475Z uiService Outgoing message ui:tests:allResultsUpdated\n',
     '2020-02-05T23:23:35.486Z uiService Outgoing message ui:coverageChanged\n' ] }
NikGovorov commented 4 years ago

Hi @Dethlore,

Could you please share src/polyfills.ts file content?

Dethlore commented 4 years ago

Of course!

/**
 * This file includes polyfills needed by Angular and is loaded before the app.
 * You can add your own extra polyfills to this file.
 *
 * This file is divided into 2 sections:
 *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
 *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
 *      file.
 *
 * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
 *
 * Learn more in https://angular.io/guide/browser-support
 */

/***************************************************************************************************
 * BROWSER POLYFILLS
 */

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js';  // Run `npm install --save classlist.js`.

/**
 * Web Animations `@angular/platform-browser/animations`
 * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
 * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
 */
// import 'web-animations-js';  // Run `npm install --save web-animations-js`.

/**
 * By default, zone.js will patch all possible macroTask and DomEvents
 * user can disable parts of macroTask/DomEvents patch by setting following flags
 * because those flags need to be set before `zone.js` being loaded, and webpack
 * will put import in the top of bundle, so user need to create a separate file
 * in this directory (for example: zone-flags.ts), and put the following flags
 * into that file, and then add the following code before importing zone.js.
 * import './zone-flags.ts';
 *
 * The flags allowed in zone-flags.ts are listed here.
 *
 * The following flags will work for all browsers.
 *
 * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
 * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
 * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
 *
 *  in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
 *  with the following flag, it will bypass `zone.js` patch for IE/Edge
 *
 *  (window as any).__Zone_enable_cross_context_check = true;
 *
 */

/***************************************************************************************************
 * Zone JS is required by default for Angular itself.
 */
import 'zone.js/dist/zone'; // Included with Angular CLI.

/***************************************************************************************************
 * APPLICATION IMPORTS
 */
NikGovorov commented 4 years ago

Looks good, could you please share your angular.json file?

Dethlore commented 4 years ago
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "mtk": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {},
      "architect": {
        "build": {
          "builder": "ngx-build-plus:build",
          "options": {
            "baseHref": "/Content/",
            "outputPath": "dist/mtk",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              {
                "input": "node_modules/fullcalendar/dist",
                "glob": "fullcalendar.css",
                "output": "./assets/styles/fullcalendar.css"
              },
              {
                "input": "node_modules/cesium/Build/Cesium",
                "glob": "**/*",
                "output": "./assets/cesium"
              },
              {
                "input": "node_modules/font-awesome/fonts",
                "glob": "**/*",
                "output": "./assets/fonts"
              },
              {
                "input": "dist/planner/assets",
                "glob": "**/*",
                "output": "./assets/planner/"
              }
            ],
            "styles": [
              "node_modules/primeicons/primeicons.css",
              "node_modules/primeng/resources/primeng.min.css",
              "node_modules/@fullcalendar/core/main.min.css",
              "node_modules/@fullcalendar/daygrid/main.min.css",
              "node_modules/@fullcalendar/list/main.min.css",
              "node_modules/@fullcalendar/timegrid/main.min.css",
              "node_modules/font-awesome/css/font-awesome.min.css",
              "node_modules/codemirror/lib/codemirror.css",
              "node_modules/codemirror/theme/oceanic-next.css",
              "src/styles.css",
              "src/assets/styles/styles.css",
              "src/assets/styles/dark.css",
              "src/assets/styles/mtk.css",
              "node_modules/cesium/Build/Cesium/Widgets/widgets.css"
            ],
            "scripts": [
              "node_modules/cesium/Build/Cesium/Cesium.js",
              "node_modules/plotly.js/dist/plotly.min.js",
              "node_modules/@fullcalendar/core/main.js",
              "node_modules/@fullcalendar/list/main.js",
              "node_modules/@fullcalendar/daygrid/main.js",
              "node_modules/@fullcalendar/timegrid/main.js",
              "node_modules/@fullcalendar/interaction/main.js"
            ]
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "20mb",
                  "maximumError": "40mb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "ngx-build-plus:dev-server",
          "options": {
            "browserTarget": "mtk:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "mtk:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "mtk:build"
          }
        },
        "test": {
          "builder": "ngx-build-plus:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": ["src/styles.css"],
            "scripts": ["./node_modules/cesium/Build/Cesium/Cesium.js"],
            "assets": ["src/favicon.ico", "src/assets"]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
            "exclude": ["**/node_modules/**"],
            "format": "checkstyle"
          }
        }
      }
    },
    "mtk-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "mtk:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "mtk:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": ["**/node_modules/**"],
            "format": "checkstyle"
          }
        }
      }
    },
  },
  "defaultProject": "mtk"
}
NikGovorov commented 4 years ago

Manual wallaby config file expects all projects to use default Angular CLI builder @angular-devkit/build-angular:karma, however from your angular.json file I see that you use third-party builder ngx-build-plus:karma. To get wallaby working for your project it may be enough to simply replace @angular-devkit/build-angular:karma with ngx-build-plus:karma in your wallaby.js config file, but if you use ngx-build-plus to provide extra custom webpack configuration for your tests than you'll have to update your wallaby's webpack configuration accordingly.

Dethlore commented 4 years ago

That did it! Ahhh thank you so much!

tjrobinson commented 3 years ago

@NikGovorov @Dethlore I am also using ngx-build-plus:karma. Since I'm using Angular 11 I believe I have to use automatic configuration. How can I go about replacing @angular-devkit/build-angular:karma with ngx-build-plus:karma if I don't have a wallaby.js file?

smcenlly commented 3 years ago

@tjrobinson - I have created #2693 to track your question/issue. We'll respond there.

aanchal88 commented 3 years ago

On running ng test , I am getting this error :-

ReferenceError: Zone is not defined at Object. (http://localhost:9876/_karma_webpack_/polyfills.js:1024:5) at http://localhost:9876/_karma_webpack_/polyfills.js:946:37 at Object.FGvd (http://localhost:9876/_karma_webpack_/polyfills.js:950:2) at webpack_require (http://localhost:9876/_karma_webpack_/polyfills.js:20:30) at Module.hN/g (http://localhost:9876/_karma_webpack_/polyfills.js:2472:97) at webpack_require (http://localhost:9876/_karma_webpack_/polyfills.js:20:30) at Object.0 (http://localhost:9876/_karma_webpack_/polyfills.js:180:1) at __webpack_require__ (http://localhost:9876/_karma_webpack_/polyfills.js:20:30) at http://localhost:9876/_karma_webpack_/polyfills.js:84:18 at http://localhost:9876/_karma_webpack_/polyfills.js:87:10

ArtemGovorov commented 3 years ago

@aanchal88 Can you please create a separate new issue and provide the details requested in a new issue template? We are happy to take a look and help.

aanchal88 commented 3 years ago

Sure!!!