wallabyjs / public

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

Wallabyjs and React script 5 #2957

Closed SMH110 closed 2 years ago

SMH110 commented 2 years ago

Issue description or question

I've created a new React project that uses react-scripts@5.0.0 and tried running tests using wallabyjs but got error

Wallaby diagnostics report

{
  editorVersion: '1.65.2',
  pluginVersion: '1.0.333',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.22000',
  nodeVersion: 'v17.2.0',
  coreVersion: '1.0.1065',
  checksum: 'OTBhNWIyNmQ3YTAxMTQxMDVjNGM2ZWE5ZGRlNTM3YWMsMTYxOTU2ODAwMDAwMCww',
  config: {
    diagnostics: {
      jest: {
        config: {
          configs: [
            {
              automock: false,
              cache: true,
              cacheDirectory: 'C:\\Users\\foo\\AppData\\Local\\Temp\\jest',
              clearMocks: false,
              coveragePathIgnorePatterns: [ '\\\\node_modules\\\\' ],
              cwd: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact',
              dependencyExtractor: undefined,
              detectLeaks: false,
              detectOpenHandles: false,
              displayName: undefined,
              errorOnDeprecated: false,
              extensionsToTreatAsEsm: [],
              extraGlobals: [],
              filter: undefined,
              forceCoverageMatch: [],
              globalSetup: undefined,
              globalTeardown: undefined,
              globals: {},
              haste: { computeSha1: false, enableSymlinks: false, forceNodeFilesystemAPI: false, throwOnModuleCollision: false },
              injectGlobals: true,
              moduleDirectories: [ 'node_modules' ],
              moduleFileExtensions: [
                'web.js',  'js',
                'web.ts',  'ts',
                'web.tsx', 'tsx',
                'json',    'web.jsx',
                'jsx',     'node'
              ],
              moduleLoader: undefined,
              moduleNameMapper: [ [ '^react-native$', 'react-native-web' ], [ '^.+\\.module\\.(css|sass|scss)$', 'identity-obj-proxy' ] ],
              modulePathIgnorePatterns: [],
              modulePaths: [],
              name: 'f560d0bc0c66d95a413585bf64be374b',
              prettierPath: 'prettier',
              resetMocks: true,
              resetModules: false,
              resolver: undefined,
              restoreMocks: false,
              rootDir: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact',
              roots: [ 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\src' ],
              runner: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\jest-runner\\build\\index.js',
              setupFiles: [ 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\react-app-polyfill\\jsdom.js' ],
              setupFilesAfterEnv: [ 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\src\\setupTests.ts' ],
              skipFilter: false,
              skipNodeResolution: undefined,
              slowTestThreshold: 5,
              snapshotFormat: undefined,
              snapshotResolver: undefined,
              snapshotSerializers: [],
              testEnvironment: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\jest-environment-jsdom\\build\\index.js',
              testEnvironmentOptions: {},
              testLocationInResults: false,
              testMatch: [
                'C:/Users/foo/Desktop/my-code/pact-tests/testing-pact/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
                'C:/Users/foo/Desktop/my-code/pact-tests/testing-pact/src/**/*.{spec,test}.{js,jsx,ts,tsx}'
              ],
              testPathIgnorePatterns: [ '\\\\node_modules\\\\' ],
              testRegex: [],
              testRunner: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\jest-circus\\runner.js',
              testURL: 'http://localhost',
              timers: 'real',
              transform: [
                [ '^.+\\.(js|jsx|mjs|cjs|ts|tsx)$', 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\react-scripts\\config\\jest\\babelTransform.js', {} ],
                [ '^.+\\.css$', 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\react-scripts\\config\\jest\\cssTransform.js', {} ],
                [
                  '^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)',
                  'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\react-scripts\\config\\jest\\fileTransform.js',
                  {}
                ]
              ],
              transformIgnorePatterns: [ '[\\\\\\\\]node_modules[\\\\\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$', '^.+\\.module\\.(css|sass|scss)$' ],
              unmockedModulePathPatterns: undefined,
              watchPathIgnorePatterns: []
            }
          ],
          globalConfig: {
            bail: 0,
            changedFilesWithAncestor: false,
            changedSince: undefined,
            collectCoverage: false,
            collectCoverageFrom: [ 'src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts' ],
            collectCoverageOnlyFrom: undefined,
            coverageDirectory: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\coverage',
            coverageProvider: 'babel',
            coverageReporters: [ 'json', 'text', 'lcov', 'clover' ],
            coverageThreshold: undefined,
            detectLeaks: false,
            detectOpenHandles: false,
            errorOnDeprecated: false,
            expand: false,
            filter: undefined,
            findRelatedTests: false,
            forceExit: false,
            globalSetup: undefined,
            globalTeardown: undefined,
            json: false,
            lastCommit: false,
            listTests: false,
            logHeapUsage: false,
            maxConcurrency: 5,
            maxWorkers: 31,
            noSCM: undefined,
            noStackTrace: false,
            nonFlagArgs: undefined,
            notify: false,
            notifyMode: 'failure-change',
            onlyChanged: false,
            onlyFailures: false,
            outputFile: undefined,
            passWithNoTests: false,
            projects: [],
            replname: undefined,
            reporters: undefined,
            rootDir: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact',
            runTestsByPath: false,
            silent: undefined,
            skipFilter: false,
            snapshotFormat: undefined,
            testFailureExitCode: 1,
            testNamePattern: undefined,
            testPathPattern: '',
            testResultsProcessor: undefined,
            testSequencer: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\@jest\\test-sequencer\\build\\index.js',
            testTimeout: undefined,
            updateSnapshot: 'new',
            useStderr: false,
            verbose: undefined,
            watch: false,
            watchAll: false,
            watchPlugins: [
              { config: {}, path: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\jest-watch-typeahead\\filename.js' },
              { config: {}, path: 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\node_modules\\jest-watch-typeahead\\testname.js' }
            ],
            watchman: true
          },
          hasDeprecationWarnings: false,
          wallaby: {
            roots: [ 'src' ],
            watchPathIgnorePatterns: [ '\\\\node_modules\\\\', '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\\\\\..+\\\\' ],
            testPathIgnorePatterns: [ '\\\\node_modules\\\\', '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\\\\\..+\\\\' ],
            testMatch: [ 'src/**/__tests__/**/*.{js,jsx,ts,tsx}', 'src/**/*.{spec,test}.{js,jsx,ts,tsx}' ],
            testRegex: []
          }
        }
      }
    },
    testFramework: { version: 'jest@24.8.0', configurator: 'jest@24.8.0', reporter: 'jest@24.8.0', starter: 'jest@24.8.0', autoDetected: true },
    filesWithCoverageCalculated: [ 'src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts' ],
    filesWithNoCoverageCalculated: [],
    globalSetup: false,
    micromatch: true,
    files: [
      { pattern: '\\\\node_modules\\\\', regexp: /\\node_modules\\/, ignore: true, trigger: true, load: true },
      { pattern: '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\\\\\..+\\\\', regexp: /\.\\dist\\|\.\\build\\|\.\\coverage\\|\\\..+\\/, ignore: true, trigger: true, load: true },
      { pattern: '**/**', ignore: false, trigger: true, load: true, order: 1 },
      { pattern: 'src/**', ignore: false, trigger: true, load: true, order: 2 },
      { pattern: 'src/**/__tests__/**/*.{js,jsx,ts,tsx}', ignore: true, trigger: true, load: true },
      { pattern: 'src/**/*.{spec,test}.{js,jsx,ts,tsx}', ignore: true, trigger: true, load: true }
    ],
    tests: [
      { pattern: '\\\\node_modules\\\\', regexp: /\\node_modules\\/, ignore: true, trigger: true, load: true, test: true },
      {
        pattern: '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\\\\\..+\\\\',
        regexp: /\.\\dist\\|\.\\build\\|\.\\coverage\\|\\\..+\\/,
        ignore: true,
        trigger: true,
        load: true,
        test: true
      },
      { pattern: 'src/**/__tests__/**/*.{js,jsx,ts,tsx}', ignore: false, trigger: true, load: true, test: true, order: 3 },
      { pattern: 'src/**/*.{spec,test}.{js,jsx,ts,tsx}', ignore: false, trigger: true, load: true, test: true, order: 4 }
    ],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    addModifiedTestFileToExclusiveTestRun: true,
    compilers: {},
    preprocessors: {},
    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,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    env: { type: 'node', params: {}, runner: 'C:\\Program Files\\nodejs\\node.exe', viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    loose: true,
    configCode: 'auto.detect#-1265640854'
  },
  packageJSON: {
    dependencies: {
      '@testing-library/jest-dom': '^5.16.3',
      '@testing-library/react': '^12.1.4',
      '@testing-library/user-event': '^13.5.0',
      '@types/jest': '^27.4.1',
      '@types/node': '^16.11.26',
      '@types/react': '^17.0.43',
      '@types/react-dom': '^17.0.14',
      react: '^17.0.2',
      'react-dom': '^17.0.2',
      'react-scripts': '5.0.0',
      typescript: '^4.6.3',
      'web-vitals': '^2.1.4'
    },
    devDependencies: { '@pact-foundation/pact-core': '^13.6.0' }
  },
  fs: { numberOfFiles: 20 },
  debug: [
    '2022-03-25T16:12:58.627Z angular/cli config Angular CLI not found.\n',
    '2022-03-25T16:12:59.180Z jest/config Detected Jest.\n',
    '2022-03-25T16:12:59.181Z jest/config Configured Jest.\n',
    '2022-03-25T16:12:59.184Z project Wallaby Node version: v17.2.0\n',
    '2022-03-25T16:12:59.184Z project Wallaby config: C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact\\auto.detect\n',
    '2022-03-25T16:12:59.321Z project File cache: C:\\Users\\foo\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.333\\projects\\efe51091605a5755\n',
    '2022-03-25T16:12:59.630Z uiService Listening port 51236\n',
    '2022-03-25T16:12:59.652Z workers Parallelism for initial run: 30, for regular run: 15\n',
    '2022-03-25T16:12:59.652Z workers Starting run worker instance #0\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #1\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #2\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #3\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #4\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #5\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #6\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #7\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #8\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #9\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #10\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #11\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #12\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #13\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #14\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #15\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #16\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #17\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #18\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #19\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #20\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #21\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #22\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #23\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #24\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #25\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #26\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #27\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #28\n',
    '2022-03-25T16:12:59.653Z workers Starting run worker instance #29\n',
    '2022-03-25T16:12:59.655Z workers Web server is listening at 57900\n',
    '2022-03-25T16:12:59.655Z project File cache requires some updates, waiting required files from IDE\n',
    '2022-03-25T16:13:00.010Z project Stopping process pool\n',
    '2022-03-25T16:13:00.012Z project Test run started; run priority: 3\n',
    '2022-03-25T16:13:00.014Z project Running all tests\n',
    '2022-03-25T16:13:00.018Z workers Starting test run, priority: 3\n',
    '2022-03-25T16:13:00.018Z nodeRunner Starting sandbox [worker #0, session #1fqs2]\n',
    '2022-03-25T16:13:00.019Z nodeRunner Preparing sandbox [worker #0, session #1fqs2]\n',
    '2022-03-25T16:13:00.059Z workers Started run worker instance (delayed) #4\n',
    '2022-03-25T16:13:00.061Z workers Started run worker instance (delayed) #2\n',
    '2022-03-25T16:13:00.093Z workers Started run worker instance (delayed) #8\n',
    '2022-03-25T16:13:00.117Z workers Started run worker instance (delayed) #9\n',
    '2022-03-25T16:13:00.128Z workers Started run worker instance (delayed) #12\n',
    '2022-03-25T16:13:00.136Z workers Started run worker instance (delayed) #11\n',
    '2022-03-25T16:13:00.170Z workers Started run worker instance (delayed) #0\n',
    '2022-03-25T16:13:00.170Z nodeRunner Prepared sandbox [worker #0, session #1fqs2]\n',
    '2022-03-25T16:13:00.170Z workers [worker #0, session #1fqs2] Running tests in sandbox\n',
    '2022-03-25T16:13:00.191Z workers Started run worker instance (delayed) #5\n',
    '2022-03-25T16:13:00.198Z workers Started run worker instance (delayed) #10\n',
    '2022-03-25T16:13:00.264Z workers Started run worker instance (delayed) #1\n',
    '2022-03-25T16:13:00.282Z workers Started run worker instance (delayed) #7\n',
    '2022-03-25T16:13:00.827Z workers Sandbox (active) [1fqs2] error: Failed to initialize wallaby jest.\n' +
      "Failed to read Jest configuration from 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact': m is not defined\n",
    '2022-03-25T16:13:00.932Z workers [1fqs2] Run 0 test(s), skipped 0 test(s)\n',
    '2022-03-25T16:13:00.935Z workers [1fqs2] Sandbox is responsive, closing it\n',
    '2022-03-25T16:13:00.936Z workers Failed to map the stack to user code, entry message: Failed to initialize wallaby jest.\n' +
      "Failed to read Jest configuration from 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact': m is not defined, stack: Failed to initialize wallaby jest.\n" +
      "Failed to read Jest configuration from 'C:\\Users\\foo\\Desktop\\my-code\\pact-tests\\testing-pact': m is not defined\n",
    '2022-03-25T16:13:00.937Z project Test run finished\n',
    '2022-03-25T16:13:00.937Z project Processed console.log entries\n',
    '2022-03-25T16:13:00.937Z project Processed loading sequences\n',
    '2022-03-25T16:13:00.937Z project Processed executed tests\n',
    '2022-03-25T16:13:00.938Z project Processed code coverage\n',
    '2022-03-25T16:13:00.943Z project Test run result processed and sent to IDE\n',
    '2022-03-25T16:13:03.697Z workers Started run worker instance (delayed) #25\n',
    '2022-03-25T16:13:03.708Z workers Started run worker instance (delayed) #20\n',
    '2022-03-25T16:13:03.714Z workers Started run worker instance (delayed) #27\n',
    '2022-03-25T16:13:03.715Z workers Started run worker instance (delayed) #23\n',
    '2022-03-25T16:13:03.716Z workers Started run worker instance (delayed) #19\n',
    '2022-03-25T16:13:03.717Z workers Started run worker instance (delayed) #24\n',
    '2022-03-25T16:13:03.718Z workers Started run worker instance (delayed) #22\n',
    '2022-03-25T16:13:03.718Z workers Started run worker instance (delayed) #15\n',
    '2022-03-25T16:13:03.719Z workers Started run worker instance (delayed) #26\n',
    '2022-03-25T16:13:03.722Z workers Started run worker instance (delayed) #14\n',
    '2022-03-25T16:13:03.723Z workers Started run worker instance (delayed) #21\n',
    '2022-03-25T16:13:03.726Z workers Started run worker instance (delayed) #16\n',
    '2022-03-25T16:13:03.794Z workers Started run worker instance (delayed) #29\n',
    '2022-03-25T16:13:03.814Z workers Started run worker instance (delayed) #18\n',
    '2022-03-25T16:13:03.814Z workers Started run worker instance (delayed) #17\n',
    '2022-03-25T16:13:03.824Z workers Started run worker instance (delayed) #28\n',
    '2022-03-25T16:13:06.628Z workers Started run worker instance (delayed) #6\n',
    '2022-03-25T16:13:06.630Z workers Started run worker instance (delayed) #3\n',
    '2022-03-25T16:13:06.751Z workers Started run worker instance (delayed) #13\n',
    '2022-03-25T16:13:54.681Z fs File changed: package-lock.json\n',
    '2022-03-25T16:13:54.688Z fs File changed: package.json\n',
    '2022-03-25T16:13:54.742Z project Test run started; run priority: 2\n',
    '2022-03-25T16:13:54.743Z testTask Test files from affected: 0, from deleted or manually requested: 0, from recently changed: 0, from loaded by: 0, from failing: 0\n',
    '2022-03-25T16:13:54.743Z project Test run finished\n',
    '2022-03-25T16:13:54.743Z project Test run data re-queued\n'
  ]
}
smcenlly commented 2 years ago

The version of Wallaby that you are using (Wallaby core) was released on 21st April, 2021 before support for React 5 was added. Your license has expired, which is why an older version of Wallaby is being used.

You may request a trial license from our website to try the latest version and confirm everything is working for you.