wallabyjs / public

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

Wallaby with Nx Workspace not working. Appears to fail on all TestBed references #2540

Closed dbigintonpro closed 4 years ago

dbigintonpro commented 4 years ago

Using Wallaby in our monorepo Nx environment provides a series of output errors that appear to be related to the loading of the tested. Running the tests via Karma, 99% pass.

Please note we are using Nx with Karma for the majority of our applications, but have a couple of nest apps using Jest. It is understood that we would need a separate config file for Jest (which we are not concerned with at this moment in time) but want to get the bulk of our tests working with Wallaby and Karam, hence our manual config file.

Wallaby diagnostics report

{
  editorVersion: '1.46.1',
  pluginVersion: '1.0.247',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.17134',
  nodeVersion: 'v12.18.2',
  coreVersion: '1.0.969',
  checksum: 'NDQyNzM1Y2NjMDY0M2ZjOTRjYzA3MGU2MjczN2QzMTIsMTYyMDA4NjQwMDAwMCww',
  config: {
    files: [
      { pattern: 'wallaby.js', load: false, instrument: false, ignore: false, trigger: true, order: 1 },
      { pattern: 'apps/documents/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 2 },
      { pattern: 'apps/digidocs/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 3 },
      { pattern: 'libs/toolkit/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 4 },
      { pattern: 'libs/shared-data-access/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 5 },
      { pattern: 'libs/shared-util/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 6 },
      { pattern: 'libs/shared-models/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 7 },
      { pattern: 'libs/digidocs/feature/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 8 },
      { pattern: 'libs/core/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 9 },
      { pattern: 'libs/digidocs/util/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 10 },
      { pattern: 'libs/digidocs/data-access/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 11 },
      { pattern: 'apps/vision/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 12 },
      { pattern: 'libs/vision/feature/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 13 },
      { pattern: 'libs/vision/data-access/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 14 },
      { pattern: 'apps/digidocs-admin/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 15 },
      { pattern: 'apps/pdb-import/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 16 },
      { pattern: 'libs/pdb-import/feature/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 17 },
      { pattern: 'libs/pdb-import/data-access/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 18 },
      { pattern: 'libs/pdb-import/util/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 19 },
      { pattern: 'libs/documents/util/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 20 },
      { pattern: 'libs/documents/feature/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 21 },
      { pattern: 'libs/documents/data-access/src/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)', load: false, ignore: false, trigger: true, instrument: true, order: 22 },
      { pattern: 'apps/documents/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/digidocs/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/toolkit/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-data-access/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-util/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-models/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/feature/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/core/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/util/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/data-access/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/vision/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/vision/feature/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/vision/data-access/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/digidocs-admin/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/pdb-import/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/feature/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/data-access/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/util/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/util/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/feature/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/data-access/src/**/*spec.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/documents/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/digidocs/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/toolkit/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-data-access/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-util/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/shared-models/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/feature/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/core/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/util/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/digidocs/data-access/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/vision/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/vision/feature/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/vision/data-access/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/digidocs-admin/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'apps/pdb-import/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/feature/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/data-access/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/pdb-import/util/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/util/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/feature/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true },
      { pattern: 'libs/documents/data-access/src/**/*.d.ts', ignore: true, trigger: true, load: true, instrument: true }
    ],
    tests: [
      { pattern: 'apps/documents/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 23 },
      { pattern: 'apps/digidocs/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 24 },
      { pattern: 'libs/toolkit/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 25 },
      { pattern: 'libs/shared-data-access/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 26 },
      { pattern: 'libs/shared-util/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 27 },
      { pattern: 'libs/shared-models/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 28 },
      { pattern: 'libs/digidocs/feature/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 29 },
      { pattern: 'libs/core/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 30 },
      { pattern: 'libs/digidocs/util/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 31 },
      { pattern: 'libs/digidocs/data-access/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 32 },
      { pattern: 'apps/vision/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 33 },
      { pattern: 'libs/vision/feature/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 34 },
      { pattern: 'libs/vision/data-access/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 35 },
      { pattern: 'apps/digidocs-admin/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 36 },
      { pattern: 'apps/pdb-import/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 37 },
      { pattern: 'libs/pdb-import/feature/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 38 },
      { pattern: 'libs/pdb-import/data-access/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 39 },
      { pattern: 'libs/pdb-import/util/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 40 },
      { pattern: 'libs/documents/util/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 41 },
      { pattern: 'libs/documents/feature/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 42 },
      { pattern: 'libs/documents/data-access/src/**/*spec.ts', load: false, ignore: false, trigger: true, test: true, order: 43 }
    ],
    testFramework: { version: 'jasmine@3.5.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,
    updateNoMoreThanOneSnapshotPerTestFileRun: 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: 'module.exports = function(wallaby) {\r\n' +
      "  const wallabyWebpack = require('wallaby-webpack');\r\n" +
      "  const path = require('path');\r\n" +
      "  const fs = require('fs');\r\n" +
      '\r\n' +
      "  const specPattern = '/**/*spec.ts';\r\n" +
      "  const angularConfig = require('./angular.json');\r\n" +
      '\r\n' +
      '  const projects = Object.keys(angularConfig.projects).map(key => {\r\n' +
      '    return { name: key, ...angularConfig.projects[key] };\r\n' +
      '  }).filter(project => project.sourceRoot)\r\n' +
      "    .filter(project => project.projectType !== 'application' ||\r\n" +
      '                       (project.architect &&\r\n' +
      '                        project.architect.test &&\r\n' +
      "                        project.architect.test.builder === '@angular-devkit/build-angular:karma'));\r\n" +
      '\r\n' +
      "  const applications = projects.filter(project => project.projectType === 'application');\r\n" +
      "  const libraries = projects.filter(project => project.projectType === 'library');\r\n" +
      '\r\n' +
      '  const tsConfigFile = projects\r\n' +
      "    .map(project => path.join(__dirname, project.root, 'tsconfig.spec.json'))\r\n" +
      '    .find(tsConfig => fs.existsSync(tsConfig));\r\n' +
      '\r\n' +
      '  const tsConfigSpec = tsConfigFile ? JSON.parse(fs.readFileSync(tsConfigFile)) : {};\r\n' +
      '\r\n' +
      "  const compilerOptions = Object.assign(require('./tsconfig.base.json').compilerOptions, tsConfigSpec.compilerOptions);\r\n" +
      '  compilerOptions.emitDecoratorMetadata = true;\r\n' +
      '\r\n' +
      '  return {\r\n' +
      '    files: [\r\n' +
      '      { pattern: path.basename(__filename), load: false, instrument: false },\r\n' +
      '      ...projects.map(project => ({\r\n' +
      "        pattern: project.sourceRoot + '/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)',\r\n" +
      '        load: false\r\n' +
      '      })),\r\n' +
      '      ...projects.map(project => ({\r\n' +
      '        pattern: project.sourceRoot + specPattern,\r\n' +
      '        ignore: true\r\n' +
      '      })),\r\n' +
      '      ...projects.map(project => ({\r\n' +
      "        pattern: project.sourceRoot + '/**/*.d.ts',\r\n" +
      '        ignore: true\r\n' +
      '      }))\r\n' +
      '    ],\r\n' +
      '\r\n' +
      '    tests: [\r\n' +
      '      ...projects.map(project => ({\r\n' +
      '        pattern: project.sourceRoot + specPattern,\r\n' +
      '        load: false\r\n' +
      '      }))\r\n' +
      '    ],\r\n' +
      '\r\n' +
      "    testFramework: 'jasmine',\r\n" +
      '\r\n' +
      '    compilers: {\r\n' +
      "      '**/*.ts': wallaby.compilers.typeScript({\r\n" +
      '        ...compilerOptions,\r\n' +
      '        getCustomTransformers: program => {\r\n' +
      '          return {\r\n' +
      '            before: [\r\n' +
      "              require('@ngtools/webpack/src/transformers/replace_resources').replaceResources(\r\n" +
      '                path => true,\r\n' +
      '                () => program.getTypeChecker(),\r\n' +
      '                false\r\n' +
      '              )\r\n' +
      '            ]\r\n' +
      '          };\r\n' +
      '        }\r\n' +
      '      })\r\n' +
      '    },\r\n' +
      '\r\n' +
      '\r\n' +
      '\r\n' +
      '    preprocessors: {\r\n' +
      '      /* Initialize Test Environment for Wallaby */\r\n' +
      '      [path.basename(__filename)]: file => `\r\n' +
      "      import 'zone.js/dist/zone-testing';\r\n" +
      "      import { getTestBed } from '@angular/core/testing';\r\n" +
      '      import {\r\n' +
      '        BrowserDynamicTestingModule,\r\n' +
      '        platformBrowserDynamicTesting,\r\n' +
      "      } from '@angular/platform-browser-dynamic/testing';\r\n" +
      '\r\n' +
      '      getTestBed().initTestEnvironment(\r\n' +
      '        BrowserDynamicTestingModule,\r\n' +
      '        platformBrowserDynamicTesting(),\r\n' +
      '      );\r\n' +
      '      `\r\n' +
      '    },\r\n' +
      '\r\n' +
      '    middleware: function(app, express) {\r\n' +
      "      const path = require('path');\r\n" +
      '\r\n' +
      '      applications.forEach(application => {\r\n' +
      '        if (\r\n' +
      '          !application.architect ||\r\n' +
      '          !application.architect.test ||\r\n' +
      '          !application.architect.test.options ||\r\n' +
      '          !application.architect.test.options.assets\r\n' +
      '        ) {\r\n' +
      '          return;\r\n' +
      '        }\r\n' +
      '\r\n' +
      '        application.architect.test.options.assets.forEach(asset => {\r\n' +
      '          if (asset && !asset.glob) {\r\n' +
      '            // Only works for file assets (not globs)\r\n' +
      '            // (https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/asset-configuration.md#project-assets)\r\n' +
      '            app.use(asset.slice(application.sourceRoot.length), express.static(path.join(__dirname, asset)));\r\n' +
      '          }\r\n' +
      '        });\r\n' +
      '      });\r\n' +
      '    },\r\n' +
      '\r\n' +
      '    env: {\r\n' +
      "      kind: 'chrome'\r\n" +
      '    },\r\n' +
      '\r\n' +
      '    postprocessor: wallabyWebpack({\r\n' +
      '      entryPatterns: [\r\n' +
      '        ...applications\r\n' +
      "          .map(project => project.sourceRoot + '/polyfills.js')\r\n" +
      "          .filter(polyfills => fs.existsSync(path.join(__dirname, polyfills.replace(/js$/, 'ts')))),\r\n" +
      '        path.basename(__filename),\r\n' +
      "        ...projects.map(project => project.sourceRoot + specPattern.replace(/ts$/, 'js'))\r\n" +
      '      ],\r\n' +
      '\r\n' +
      '      module: {\r\n' +
      '        rules: [\r\n' +
      "          { test: /\\.css$/, loader: ['raw-loader'] },\r\n" +
      "          { test: /\\.html$/, loader: 'raw-loader' },\r\n" +
      '          {\r\n' +
      '            test: /\\.ts$/,\r\n' +
      "            loader: '@ngtools/webpack',\r\n" +
      '            include: /node_modules/,\r\n' +
      "            query: { tsConfigPath: 'tsconfig.base.json' }\r\n" +
      '          },\r\n' +
      "          { test: /\\.styl$/, loaders: ['raw-loader', 'stylus-loader'] },\r\n" +
      "          { test: /\\.less$/, loaders: ['raw-loader', { loader: 'less-loader' }] },\r\n" +
      '          {\r\n' +
      '            test: /\\.scss$|\\.sass$/,\r\n' +
      "            // loaders: [{ loader: 'raw-loader' }, { loader: 'sass-loader', options: { implementation: require('sass') } }]\r\n" +
      "            loaders: ['null-loader'],\r\n" +
      '          },\r\n' +
      "          { test: /\\.(jpg|png|svg)$/, loader: 'raw-loader' }\r\n" +
      '        ]\r\n' +
      '      },\r\n' +
      '\r\n' +
      '      resolve: {\r\n' +
      "        extensions: ['.js', '.ts'],\r\n" +
      '        modules: [\r\n' +
      '          wallaby.projectCacheDir,\r\n' +
      '          ...(projects.length ? projects.filter(project => project.root)\r\n' +
      '            .map(project => path.join(wallaby.projectCacheDir, project.root)) : []),\r\n' +
      '          ...(projects.length ? projects.filter(project => project.sourceRoot)\r\n' +
      '            .map(project => path.join(wallaby.projectCacheDir,project.sourceRoot)) : []),\r\n' +
      "          'node_modules'\r\n" +
      '        ],\r\n' +
      '        alias: {\r\n' +
      "          '@env/digidocs/environment': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'apps/digidocs/src/environments/environment'\r\n" +
      '          ),\r\n' +
      "          '@env/documents/environment': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'apps/documents/src/environments/environment'\r\n" +
      '          ),\r\n' +
      "          '@env/pdb-import/environment': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'apps/pdb-import/src/environments/environment'\r\n" +
      '          ),\r\n' +
      "          '@env/vision/environment': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'apps/vision/src/environments/environment'\r\n" +
      '          ),\r\n' +
      "          '@lazard/shared-util': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/shared-util/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/shared-data-access': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/shared-data-access/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/shared-models': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/shared-models/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/toolkit': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/toolkit/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/core': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/core/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/documents/util': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/documents/util/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/documents/data-access': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/documents/data-access/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/documents/feature': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/documents/feature/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/digidocs/util': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/digidocs/util/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/digidocs/data-access': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/digidocs/data-access/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/digidocs/feature': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/digidocs/feature/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/pdb-import/util': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/pdb-import/util/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/pdb-import/data-access': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/pdb-import/data-access/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/pdb-import/feature': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/pdb-import/feature/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/vision/data-access': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/vision/data-access/src/index'\r\n" +
      '          ),\r\n' +
      "          '@lazard/vision/feature': path.join(\r\n" +
      '            wallaby.projectCacheDir,\r\n' +
      "            'libs/vision/feature/src/index'\r\n" +
      '          ),\r\n' +
      '        },\r\n' +
      '      }\r\n' +
      '    }),\r\n' +
      '\r\n' +
      '    setup: function() {\r\n' +
      '      window.__moduleBundler.loadTests();\r\n' +
      '    }\r\n' +
      '  };\r\n' +
      '};\r\n'
  },
  packageJSON: {
    dependencies: {
      '@ag-grid-community/angular': '^22.1.2',
      '@angular-devkit/core': '10.1.7',
      '@angular-devkit/schematics': '10.1.7',
      '@angular/animations': '10.1.6',
      '@angular/cdk': '^10.2.5',
      '@angular/common': '10.1.6',
      '@angular/compiler': '10.1.6',
      '@angular/core': '10.1.6',
      '@angular/forms': '10.1.6',
      '@angular/material': '^10.2.5',
      '@angular/material-moment-adapter': '^10.2.5',
      '@angular/platform-browser': '10.1.6',
      '@angular/platform-browser-dynamic': '10.1.6',
      '@angular/pwa': '^0.1000.6',
      '@angular/router': '10.1.6',
      '@hapi/joi': '^17.1.1',
      '@nestjs/common': '^7.0.7',
      '@nestjs/config': '^0.5.0',
      '@nestjs/core': '^7.0.7',
      '@nestjs/mongoose': '^7.0.2',
      '@nestjs/platform-express': '^7.0.7',
      '@nestjs/swagger': '^4.5.1',
      '@nestjs/typeorm': '^7.0.0',
      '@ngrx/effects': '10.0.0',
      '@ngrx/entity': '10.0.0',
      '@ngrx/router-store': '10.0.0',
      '@ngrx/store': '10.0.0',
      '@nrwl/angular': '10.3.1',
      '@nrwl/nx-cloud': '^10.1.6',
      '@schematics/angular': '10.1.7',
      '@types/dotenv': '^8.2.0',
      'ag-grid-angular': '^22.1.1',
      'ag-grid-community': '^22.1.1',
      'ag-grid-enterprise': '^22.1.1',
      axios: '^0.19.2',
      camaro: '^6.0.3',
      'class-transformer': '^0.3.1',
      'class-validator': '^0.12.2',
      'classlist.js': '^1.1.20150312',
      'core-js': '^3.6.4',
      'custom-env': '^2.0.1',
      'date-fns': '^2.15.0',
      dotenv: '^8.2.0',
      'dotenv-safe': '^8.2.0',
      'express-rate-limit': '^5.1.3',
      helmet: '^4.1.0',
      'keyboardevent-key-polyfill': '^1.1.0',
      moment: '^2.24.0',
      mongoose: '^5.9.7',
      mssql: '^6.1.0',
      mysql: '^2.18.1',
      'ngx-cookie-service': '^10.0.1',
      'reflect-metadata': '^0.1.12',
      rxjs: '^6.6.3',
      'smoothscroll-polyfill': '^0.4.4',
      svgxuse: '^1.2.6',
      'swagger-ui-express': '^4.1.3',
      tachyons: '^4.12.0',
      tslib: '^2.0.1',
      typeorm: '^0.2.22',
      'zone.js': '^0.10.3'
    },
    devDependencies: {
      '@angular-devkit/build-angular': '0.1001.7',
      '@angular-devkit/build-ng-packagr': '0.1001.7',
      '@angular/cli': '10.1.7',
      '@angular/compiler-cli': '10.1.6',
      '@angular/language-service': '10.1.6',
      '@compodoc/compodoc': '^1.1.11',
      '@nestjs/schematics': '^7.0.0',
      '@nestjs/testing': '^7.0.7',
      '@ngrx/store-devtools': '10.0.0',
      '@nrwl/cli': '10.3.1',
      '@nrwl/jest': '10.3.1',
      '@nrwl/nest': '10.3.1',
      '@nrwl/node': '10.3.1',
      '@nrwl/workspace': '10.3.1',
      '@types/hapi__joi': '^17.1.4',
      '@types/jasmine': '^3.5.10',
      '@types/jasminewd2': '^2.0.8',
      '@types/jest': '26.0.8',
      '@types/mongoose': '^5.7.8',
      '@types/node': '^14.6.0',
      'angular2-template-loader': '^0.6.2',
      codelyzer: '^6.0.0',
      commitizen: '^4.1.2',
      'cz-conventional-changelog': '^3.1.0',
      electron: '^9.2.1',
      husky: '^4.2.3',
      'jasmine-core': '^3.5.0',
      'jasmine-marbles': '^0.6.0',
      'jasmine-spec-reporter': '~5.0.1',
      jest: '26.2.2',
      karma: '^5.1.1',
      'karma-chrome-launcher': '^3.1.0',
      'karma-coverage-istanbul-reporter': '^3.0.3',
      'karma-jasmine': '^4.0.1',
      'karma-jasmine-html-reporter': '^1.5.3',
      'karma-spec-reporter': '0.0.32',
      kss: '^3.0.0',
      'lint-staged': '^10.1.1',
      michelangelo: '^0.8.0',
      'ng-mock': '^0.10.10',
      'ng-packagr': '^10.0.4',
      'npm-run-all': '^4.1.5',
      'null-loader': '^4.0.1',
      prettier: '2.0.5',
      'pretty-quick': '^2.0.1',
      protractor: '^7.0.0',
      'schematics-utilities': '^1.1.3',
      'scss-to-json': '^2.0.0',
      'standard-version': '^9.0.0',
      stylelint: '^13.1.0',
      'stylelint-config-standard': '^20.0.0',
      'ts-jest': '26.4.0',
      'ts-node': '^8.8.1',
      tsickle: '^0.39.1',
      tslint: '~6.1.0',
      typescript: '4.0.3',
      'wallaby-webpack': '^3.9.15'
    }
  },
  fs: { numberOfFiles: 1113 },
  debug: [
    '2020-10-17T03:19:15.543Z project Wallaby Node version: v12.18.2\n',
    '2020-10-17T03:19:15.543Z project Wallaby config: C:\\Development\\repos\\cx-app-portal\\wallaby.js\n',
    '2020-10-17T03:19:20.123Z project File cache: C:\\Users\\bigintond\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.247\\projects\\2cd896d66c44285c\n',
    '2020-10-17T03:19:20.218Z uiService Listening port 51235\n',
    '2020-10-17T03:19:20.263Z project Config file change detected, invalidating local cache\n',
    '2020-10-17T03:19:21.299Z workers Parallelism for initial run: 6, for regular run: 3\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #0\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #1\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #2\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #3\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #4\n',
    '2020-10-17T03:19:21.300Z workers Starting run worker instance #5\n',
    '2020-10-17T03:19:21.306Z workers Web server is listening at 51994\n',
    '2020-10-17T03:19:21.357Z project File cache requires some updates, waiting required files from IDE\n',
    '2020-10-17T03:19:21.943Z extended-core New document or complex document change\n',
    '2020-10-17T03:19:21.948Z extended-core New document or complex document change\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #0\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #1\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #2\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #3\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #4\n',
    '2020-10-17T03:19:22.579Z workers Started run worker instance (immediate) #5\n',
    '2020-10-17T03:19:30.683Z project Stopping process pool\n',
    '2020-10-17T03:19:30.691Z project Running postprocessor\n',
    '2020-10-17T03:19:30.911Z postprocessor New TypeScript language service is required\n',
    '2020-10-17T03:20:00.264Z postprocessor New compiler created\n',
    '2020-10-17T03:20:00.950Z postprocessor Webpack compilation started\n',
    '2020-10-17T03:24:20.581Z postprocessor Webpack compilation finished\n',
    '2020-10-17T03:24:23.275Z postprocessor Emitting 1937 files\n',
    '2020-10-17T03:24:23.680Z project Postprocessor execution finished\n',
    '2020-10-17T03:24:23.680Z project Test run started; run priority: 3\n',
    '2020-10-17T03:24:23.698Z project Running all tests\n',
    '2020-10-17T03:24:23.784Z workers Starting test run, priority: 3\n',
    '2020-10-17T03:24:23.784Z workers Distributing tests between 6 workers\n',
    '2020-10-17T03:24:23.789Z workers Running tests in parallel\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #0, session #bpzdf]\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #1, session #8akvd]\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #2, session #99t5d]\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #3, session #fjrwu]\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #4, session #wn0b3]\n',
    '2020-10-17T03:24:23.790Z chromeRunner Starting sandbox [worker #5, session #p9mua]\n',
    '2020-10-17T03:24:23.791Z chromeRunner Preparing sandbox [worker #0, session #bpzdf]\n',
    '2020-10-17T03:24:23.803Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.813Z browserRunner Sandbox is generated [worker #0, session #bpzdf]: http://localhost:51994/wallaby_sandbox0.html\n',
    '2020-10-17T03:24:23.813Z chromeRunner Preparing sandbox [worker #1, session #8akvd]\n',
    '2020-10-17T03:24:23.815Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.819Z browserRunner Sandbox is generated [worker #1, session #8akvd]: http://localhost:51994/wallaby_sandbox1.html\n',
    '2020-10-17T03:24:23.819Z chromeRunner Preparing sandbox [worker #2, session #99t5d]\n',
    '2020-10-17T03:24:23.820Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.825Z browserRunner Sandbox is generated [worker #2, session #99t5d]: http://localhost:51994/wallaby_sandbox2.html\n',
    '2020-10-17T03:24:23.825Z chromeRunner Preparing sandbox [worker #3, session #fjrwu]\n',
    '2020-10-17T03:24:23.826Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.833Z browserRunner Sandbox is generated [worker #3, session #fjrwu]: http://localhost:51994/wallaby_sandbox3.html\n',
    '2020-10-17T03:24:23.833Z chromeRunner Preparing sandbox [worker #4, session #wn0b3]\n',
    '2020-10-17T03:24:23.834Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.837Z browserRunner Sandbox is generated [worker #4, session #wn0b3]: http://localhost:51994/wallaby_sandbox4.html\n',
    '2020-10-17T03:24:23.838Z chromeRunner Preparing sandbox [worker #5, session #p9mua]\n',
    '2020-10-17T03:24:23.838Z browserRunner Total files to load in sandbox: 39\n',
    '2020-10-17T03:24:23.842Z browserRunner Sandbox is generated [worker #5, session #p9mua]: http://localhost:51994/wallaby_sandbox5.html\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #0, session #bpzdf]\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #1, session #8akvd]\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #2, session #99t5d]\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #3, session #fjrwu]\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #4, session #wn0b3]\n',
    '2020-10-17T03:24:23.843Z chromeRunner Prepared sandbox [worker #5, session #p9mua]\n',
    '2020-10-17T03:24:23.843Z workers [worker #0, session #bpzdf] Running tests in sandbox\n',
    '2020-10-17T03:24:23.844Z workers [worker #1, session #8akvd] Running tests in sandbox\n',
    '2020-10-17T03:24:23.845Z workers [worker #2, session #99t5d] Running tests in sandbox\n',
    '2020-10-17T03:24:23.846Z workers [worker #3, session #fjrwu] Running tests in sandbox\n',
    '2020-10-17T03:24:23.846Z workers [worker #4, session #wn0b3] Running tests in sandbox\n',
    '2020-10-17T03:24:23.847Z workers [worker #5, session #p9mua] Running tests in sandbox\n',
    '2020-10-17T03:24:30.168Z workers [p9mua] Loaded 237 test(s)\n',
    '2020-10-17T03:24:30.171Z workers [p9mua] Test executed: should hide notifications badge by default\n',
    '2020-10-17T03:24:30.178Z workers Failed to map the stack to user code, entry message: TypeError: input.match is not a function, stack: TypeError: input.match is not a function\n' +
      '    at extractCommentsWithHash (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:70839:18)\n' +
      '    at ShadowCss.shimCssText (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:70483:34)\n' +
      '    at http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80805:26\n' +
      '    at Array.map (<anonymous>)\n' +
      '    at compileStyles (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80804:19)\n' +
      '    at compileComponentFromMetadata (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80299:13)\n' +
      '    at CompilerFacadeImpl.compileComponent (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80921:21)\n' +
      '    at Function.get (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:27212:47)\n' +
      '    at getComponentDef (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:2746:16)\n' +
      '    at http://loc\n',
    '2020-10-17T03:24:30.185Z workers [p9mua] Test executed: should show notifications badge if notifications > 0\n',
    '2020-10-17T03:24:30.185Z workers Failed to map the stack to user code, entry message: TypeError: input.match is not a function, stack: TypeError: input.match is not a function\n' +
      '    at extractCommentsWithHash (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:70839:18)\n' +
      '    at ShadowCss.shimCssText (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:70483:34)\n' +
      '    at http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80805:26\n' +
      '    at Array.map (<anonymous>)\n' +
      '    at compileStyles (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80804:19)\n' +
      '    at compileComponentFromMetadata (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80299:13)\n' +
      '    at CompilerFacadeImpl.compileComponent (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80921:21)\n' +
      '    at Function.get (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:27212:47)\n' +
      '    at getComponentDef (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:2746:16)\n' +
      '    at http://loc\n',
    '2020-10-17T03:24:30.192Z workers [p9mua] Test executed: should allow hideSettings toggle\n',
    '2020-10-17T03:24:30.193Z workers Failed to map the stack to user code, entry message: SyntaxError: Unexpected identifier, stack: SyntaxError: Unexpected identifier\n' +
      '    at new Function (<anonymous>)\n' +
      '    at JitEvaluator.evaluateCode (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:68405:20)\n' +
      '    at JitEvaluator.evaluateStatements (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:68375:21)\n' +
      '    at CompilerFacadeImpl.jitExpression (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80958:39)\n' +
      '    at CompilerFacadeImpl.compileComponent (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:80923:21)\n' +
      '    at Function.get (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:27212:47)\n' +
      '    at getComponentDef (http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:2746:16)\n' +
      '    at http://localhost:51994/____wallaby-bundle.js?1602905063549&wallabyFileId=bundle:27010:34\n' +
      '    at Array.forEach (<anonymous>)\n' +
      '    at setScopeOnDeclaredComponents (http://localhost:51994/____wallaby-bundle.js\n',
      ...TRUNCATED DUE TO COMMENT LIMITATIONS
  ]
}
smcenlly commented 4 years ago

Your stack trace shows that the source of your problem is within Angular's compiler extractCommentsWithHash.

We can also see from your wallaby configuration that you are using a null-loader for your styles. Our assumption is that this is what is causing your tests to fail. Could you please try updating your configuration to use a loader for your styles?

wallaby.js

module.exports = function(wallaby) {
  ...
  return {
    ...
    postprocessor: wallabyWebpack({
      ...
      module: {
        rules: [
        ...
          {
            test: /\.scss$|\.sass$/,
-           // loaders: [{ loader: 'raw-loader' }, { loader: 'sass-loader', options: { implementation: require('sass') } }]
-           loaders: ['null-loader'],
+           loaders: [{ loader: 'raw-loader' }, { loader: 'sass-loader', options: { implementation: require('sass') } }]
+           // loaders: ['null-loader'],
          },
        ...
        ]
      ...
      },
      ...
    }),
    ...
  };
};
smcenlly commented 4 years ago

I'm going to close this issue, as above, we assume the loader was the cause of the problem. If you're still having issues, please let us know and we'll re-open the issue.