wallabyjs / public

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

How to force Wallaby to run using Jest #3349

Closed shanehsi closed 8 months ago

shanehsi commented 8 months ago

Issue description or question

In the nx repo, it's no longer possible to force Wallaby to run Jest. Previously, it was possible. It seems that Wallaby is reading the defaultProject from nx.json, and this defaultProject is configured using Jest. I would like to know if it's possible to force Wallaby to use Jest.

more backgroud: This project is an nx monorepo. Some projects are configured with Jest, while others have switched to using Vitest (for speed). However, it was discovered that Wallaby has some issues when running on Vitest (old versions, I do not want to upgrade now) and it's not working out of the box. On the other hand, Jest is very stable.

Wallaby diagnostics report

{
  editorVersion: '1.87.2',
  pluginVersion: '1.0.374',
  editorType: 'VSCode',
  osVersion: 'darwin 22.2.0',
  nodeVersion: 'v18.19.0',
  coreVersion: '1.0.1548',
  checksum: 'ZGU3ZDI3YmZhZDJhZTJhYzdiNjBhMmE5YTY0OTQ5ZGIsMTcyMjkwMjQwMDAwMCww',
  config: {
    testFramework: { version: 'vitest@0.14.0', configurator: 'vitest@0.14.0', reporter: 'vitest@0.14.0', starter: 'vitest@0.14.0', autoDetected: true },
    workers: { regular: 1, initial: 1, recycle: false },
    files: [
      { pattern: 'libs/cms-admin-services/src/**/*.ts', ignore: false, trigger: true, load: true, order: 1 },
      { pattern: 'libs/cms-admin-services/src/**/*.spec.ts', ignore: true, trigger: true, load: true, file: true }
    ],
    tests: [ { pattern: 'libs/cms-admin-services/src/**/*.spec.ts', ignore: false, trigger: true, load: true, test: true, order: 2 } ],
    diagnostics: {
      vitest: {
        config: {
          config: {
            allowOnly: true,
            watch: true,
            globals: false,
            environment: 'node',
            threads: true,
            clearMocks: false,
            restoreMocks: false,
            mockReset: false,
            include: [ '**/*.{test,spec}.?(c|m)[jt]s?(x)' ],
            exclude: [
              '**/node_modules/**',
              '**/dist/**',
              '**/cypress/**',
              '**/.{idea,git,cache,output,temp}/**',
              '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
            ],
            testTimeout: 5000,
            hookTimeout: 10000,
            teardownTimeout: 10000,
            isolate: true,
            watchExclude: [ '**/node_modules/**', '**/dist/**' ],
            forceRerunTriggers: [ '**/package.json/**', '**/{vitest,vite}.config.*/**' ],
            update: false,
            reporters: [ 'default' ],
            silent: false,
            hideSkippedTests: false,
            ui: false,
            uiBase: '/__vitest__/',
            open: true,
            css: { include: [], modules: { classNameStrategy: 'stable' } },
            coverage: {
              provider: 'v8',
              enabled: false,
              clean: true,
              cleanOnRerun: true,
              reportsDirectory: './coverage',
              exclude: [
                'coverage/**',
                'dist/**',
                'packages/*/test?(s)/**',
                '**/*.d.ts',
                '**/virtual:*',
                '**/__x00__*',
                '**/\x00*',
                'cypress/**',
                'test?(s)/**',
                'test?(-*).?(c|m)[jt]s?(x)',
                '**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)',
                '**/__tests__/**',
                '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
                '**/vitest.{workspace,projects}.[jt]s?(on)',
                '**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}'
              ],
              reportOnFailure: false,
              reporter: [ [ 'text', {} ], [ 'html', {} ], [ 'clover', {} ], [ 'json', {} ] ],
              extension: [
                '.js',  '.cjs',
                '.mjs', '.ts',
                '.mts', '.cts',
                '.tsx', '.jsx',
                '.vue', '.svelte'
              ],
              allowExternal: false
            },
            fakeTimers: { loopLimit: 10000, shouldClearNativeTimers: true, toFake: [ 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate', 'Date' ] },
            maxConcurrency: 5,
            dangerouslyIgnoreUnhandledErrors: false,
            typecheck: {
              checker: 'tsc',
              include: [ '**/*.{test,spec}-d.?(c|m)[jt]s?(x)' ],
              exclude: [
                '**/node_modules/**',
                '**/dist/**',
                '**/cypress/**',
                '**/.{idea,git,cache,output,temp}/**',
                '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
              ]
            },
            slowTestThreshold: 300,
            defines: {},
            root: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects',
            mode: [],
            inspect: false,
            inspectBrk: false,
            singleThread: false,
            deps: {
              moduleDirectories: [ '/node_modules/' ],
              optimizer: { ssr: { enabled: true }, web: { enabled: true } },
              web: { transformAssets: true, transformCss: true, transformGlobPattern: [] }
            },
            server: { deps: { inline: [ {}, {}, {}, '@nuxt/test-utils' ], moduleDirectories: [ '/node_modules/' ], cacheDir: 'node_modules/.vite' } },
            snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new', snapshotEnvironment: null },
            experimentalVmWorkerMemoryLimit: 2863311530,
            setupFiles: [],
            cache: { dir: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.vitest' },
            sequence: { hooks: 'parallel' },
            environmentMatchGlobs: [],
            browser: { enabled: false, headless: false, slowHijackESM: true, api: { port: 63315 } },
            testTransformMode: {}
          },
          projects: [
            {
              path: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects',
              config: {
                allowOnly: true,
                watch: true,
                globals: false,
                environment: 'node',
                threads: true,
                clearMocks: false,
                restoreMocks: false,
                mockReset: false,
                include: [ '**/*.{test,spec}.?(c|m)[jt]s?(x)' ],
                exclude: [
                  '**/node_modules/**',
                  '**/dist/**',
                  '**/cypress/**',
                  '**/.{idea,git,cache,output,temp}/**',
                  '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
                ],
                testTimeout: 5000,
                hookTimeout: 10000,
                teardownTimeout: 10000,
                isolate: true,
                watchExclude: [ '**/node_modules/**', '**/dist/**' ],
                forceRerunTriggers: [ '**/package.json/**', '**/{vitest,vite}.config.*/**' ],
                update: false,
                reporters: [ 'default' ],
                silent: false,
                hideSkippedTests: false,
                ui: false,
                uiBase: '/__vitest__/',
                open: true,
                css: { include: [], modules: { classNameStrategy: 'stable' } },
                coverage: {
                  provider: 'v8',
                  enabled: false,
                  clean: true,
                  cleanOnRerun: true,
                  reportsDirectory: './coverage',
                  exclude: [
                    'coverage/**',
                    'dist/**',
                    'packages/*/test?(s)/**',
                    '**/*.d.ts',
                    '**/virtual:*',
                    '**/__x00__*',
                    '**/\x00*',
                    'cypress/**',
                    'test?(s)/**',
                    'test?(-*).?(c|m)[jt]s?(x)',
                    '**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)',
                    '**/__tests__/**',
                    '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
                    '**/vitest.{workspace,projects}.[jt]s?(on)',
                    '**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}'
                  ],
                  reportOnFailure: false,
                  reporter: [ [ 'text', {} ], [ 'html', {} ], [ 'clover', {} ], [ 'json', {} ] ],
                  extension: [
                    '.js',  '.cjs',
                    '.mjs', '.ts',
                    '.mts', '.cts',
                    '.tsx', '.jsx',
                    '.vue', '.svelte'
                  ],
                  allowExternal: false
                },
                fakeTimers: { loopLimit: 10000, shouldClearNativeTimers: true, toFake: [ 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate', 'Date' ] },
                maxConcurrency: 5,
                dangerouslyIgnoreUnhandledErrors: false,
                typecheck: {
                  checker: 'tsc',
                  include: [ '**/*.{test,spec}-d.?(c|m)[jt]s?(x)' ],
                  exclude: [
                    '**/node_modules/**',
                    '**/dist/**',
                    '**/cypress/**',
                    '**/.{idea,git,cache,output,temp}/**',
                    '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
                  ]
                },
                slowTestThreshold: 300,
                defines: {},
                root: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects',
                mode: [],
                inspect: false,
                inspectBrk: false,
                singleThread: false,
                deps: {
                  moduleDirectories: [ '/node_modules/' ],
                  optimizer: { ssr: { enabled: true }, web: { enabled: true } },
                  web: { transformAssets: true, transformCss: true, transformGlobPattern: [] }
                },
                server: { deps: { inline: [ {}, {}, {}, '@nuxt/test-utils' ], moduleDirectories: [ '/node_modules/' ] } },
                snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new', snapshotEnvironment: null },
                experimentalVmWorkerMemoryLimit: 2863311530,
                setupFiles: [],
                cache: { dir: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.vitest' },
                sequence: { hooks: 'parallel' },
                environmentMatchGlobs: [],
                browser: { enabled: false, headless: false, slowHijackESM: true, api: { port: 63315 } },
                testTransformMode: {}
              }
            }
          ],
          package: {
            version: '0.34.3',
            urls: { hooks: 'file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.374/wallabyc8249a/runners/node/hooks.mjs' },
            paths: {
              root: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest',
              dist: '<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist'
            }
          }
        }
      }
    },
    preserveComments: false,
    extractComments: true,
    dot: true,
    captureConsoleLog: true,
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: {},
    logLimits: { inline: { depth: 5, elements: 5000 }, values: { default: { stringLength: 8192 }, autoExpand: { elements: 5000, stringLength: 8192, depth: 10 } } },
    preprocessors: {},
    maxConsoleMessagesPerTest: 100,
    autoConsoleLog: true,
    delays: { run: 0, edit: 100, update: 0 },
    teardown: undefined,
    hints: {
      ignoreCoverage: '__REGEXP /ignore coverage|istanbul ignore|c8 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: '<homeDir>/.nvm/versions/node/v18.19.0/bin/node', viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    runAllTestsWhenNoAffectedTests: true,
    symlinkNodeModules: undefined,
    configCode: 'module.exports = function (wallaby) {\n' +
      '  return {\n' +
      '    // Tell Wallaby to only try configuring with vitest\n' +
      "    // Default is: ['angular', 'jest', 'vitest']\n" +
      "    autoDetect: ['jest'],\n" +
      '\n' +
      '    testFramework: {\n' +
      "      version: 'jest@28.1.1', \n" +
      "      configurator: 'jest@28.1.1', \n" +
      "      reporter: 'jest@28.1.1', \n" +
      "      starter: 'jest@28.1.1', \n" +
      '      autoDetected: true\n' +
      '    },\n' +
      '    // Limit how many processes Wallaby will use, for example:\n' +
      '    // 1 process for incremental runs, 2 processes at startup\n' +
      '    workers: { regular: 1, initial: 2 },\n' +
      '\n' +
      '    // modify `files` automatic configuration settings\n' +
      '    files: {\n' +
      '      override: filePatterns => {\n' +
      '        // TODO: modify `filePatterns` array as required\n' +
      '        // return filePatterns;\n' +
      "        return ['libs/cms-admin-services/src/**/*.ts', '!libs/cms-admin-services/src/**/*.spec.ts']\n" +
      '      },\n' +
      '    },\n' +
      '\n' +
      '    // modify `tests` automatic configuration settings\n' +
      '    tests: {\n' +
      '      override: testPatterns => {\n' +
      '        // TODO: modify `testPatterns` array as required\n' +
      '        // return testPatterns;\n' +
      "        return ['libs/cms-admin-services/src/**/*.spec.ts']\n" +
      '      },\n' +
      '    },\n' +
      '  }\n' +
      '}\n'
  },
  packageJSON: {
    dependencies: {
      '@anatine/zod-mock': '^3.1.1',
      '@anatine/zod-openapi': 'file:.yalc/@anatine/zod-openapi',
      '@ant-design/icons': '^4.8.0',
      '@asteasolutions/zod-to-openapi': '^6.3.1',
      '@aws-sdk/client-s3': '^3.465.0',
      '@aws-sdk/client-sts': '3.398.0',
      '@aws-sdk/lib-storage': '^3.481.0',
      '@cashier/web': '^0.6.0',
      '@casl/ability': '^6.3.2',
      '@casl/prisma': '^1.4.1',
      '@elastic/datemath': '^5.0.2',
      '@elastic/eui': '^92.1.1',
      '@emotion/css': '^11.11.2',
      '@emotion/react': '^11.11.3',
      '@flowda/schema': 'file:.yalc/@flowda/schema',
      '@flowda/types': 'file:.yalc/@flowda/types',
      '@golevelup/ts-jest': '^0.3.4',
      '@lit/react': '^1.0.3',
      '@nestjs/common': '^9.0.0',
      '@nestjs/core': '^9.0.0',
      '@nestjs/jwt': '^9.0.0',
      '@nestjs/passport': '^9.0.0',
      '@nestjs/platform-express': '^9.0.0',
      '@nestjs/schedule': '^4.0.0',
      '@nestjs/schematics': '^9.0.0',
      '@nestjs/swagger': '^6.1.3',
      '@nestjs/testing': '^9.0.0',
      '@next-auth/prisma-adapter': '^1.0.5',
      '@paralleldrive/cuid2': '^2.2.2',
      '@planetscale/database': '^1.7.0',
      '@pmmmwh/react-refresh-webpack-plugin': '^0.5.7',
      '@prisma/client': '^4.16.2',
      '@prisma/client-cms_admin': 'link:.yalc/@prisma/client-cms_admin',
      '@prisma/client-flowda': 'link:.yalc/@prisma/client-flowda',
      '@prisma/internals': '^4.16.2',
      '@prisma/nextjs-monorepo-workaround-plugin': '4.16.2',
      '@quiet-front-end/json-schema-editor-antd': '^0.3.0',
      '@radix-ui/react-accordion': '^1.0.1',
      '@radix-ui/react-dialog': '^1.0.0',
      '@radix-ui/react-navigation-menu': '^1.1.2',
      '@radix-ui/react-popover': '^1.0.5',
      '@radix-ui/react-slider': '^1.1.0',
      '@radix-ui/react-slot': '^1.0.2',
      '@radix-ui/react-switch': '^1.0.1',
      '@radix-ui/react-tooltip': '^1.0.2',
      '@rebass/grid': '^6.1.0',
      '@sindresorhus/slugify': '^2.2.1',
      '@splinetool/react-spline': '^2.2.3',
      '@splinetool/runtime': '^0.9.146',
      '@stripe/stripe-js': '^1.44.1',
      '@svgr/webpack': '^6.1.2',
      '@tanstack/react-table': '^8.14.0',
      '@testing-library/react': '13.4.0',
      '@trpc/client': '^10.44.1',
      '@trpc/server': '^10.44.1',
      '@upstash/qstash': '^0.3.6',
      '@upstash/ratelimit': '^0.3.6',
      '@upstash/redis': '1.18.0',
      '@vercel/analytics': '^1.0.0',
      '@vercel/edge': '^0.3.1',
      '@vercel/edge-config': '^0.1.0-canary.15',
      '@vercel/og': '^0.5.20',
      '@visx/axis': '^2.14.0',
      '@visx/event': '^2.6.0',
      '@visx/geo': '^2.10.0',
      '@visx/grid': '^2.12.2',
      '@visx/responsive': '^2.10.0',
      '@visx/scale': '^2.18.0',
      '@visx/shape': '^2.12.2',
      '@visx/tooltip': '^2.16.0',
      'ag-grid-community': '^31.0.1',
      'ag-grid-enterprise': '^31.0.1',
      'ag-grid-react': '^31.0.1',
      'ai-gen-utils': 'file:.yalc/ai-gen-utils',
      antd: '5.1.1',
      'antd-mobile': '^5.28.1',
      axios: '1.1.0',
      bcrypt: '^5.1.0',
      bottleneck: '^2.19.5',
      'cache-manager': '^5.2.4',
      'camunda-external-task-client-js': '^3.0.1',
      cheerio: '^0.22.0',
      'chrome-launcher': '^1.0.0',
      'class-transformer': '^0.5.1',
      'class-validator': '^0.13.2',
      'class-validator-jsonschema': '^3.1.1',
      'class-variance-authority': '^0.7.0',
      classnames: '^2.3.2',
      cloudinary: '^1.40.0',
      clsx: '^1.2.1',
      cmdk: '^0.2.0',
      cobe: '^0.6.3',
      consola: '^3.2.3',
      contentlayer: '^0.3.4',
      'cookie-parser': '^1.4.6',
      'copy-to-clipboard': '^3.3.3',
      'core-js': '^3.6.5',
      'cos-nodejs-sdk-v5': '^2.11.15',
      cron: '3.1.3',
      'cron-parser': '^4.9.0',
      cronstrue: '^2.32.0',
      'crypto-js': '^4.1.1',
      cuid: '^2.1.8',
      cypress: '^12.2.0',
      dayjs: '^1.11.6',
      dotenv: '^16.0.3',
      'dotenv-cli': '^6.0.0',
      ejs: '^3.1.9',
      envalid: '^7.3.1',
      execa: '^5.1.1',
      express: '^4.18.2',
      'express-session': '^1.17.3',
      'focus-trap-react': '^10.0.1',
      formik: '^1.5.8',
      'framer-motion': '^10.12.12',
      'fs-extra': '^11.1.0',
      'fuse.js': '^6.6.2',
      'github-slugger': '^2.0.0',
      gsap: '^3.12.2',
      handlebars: '^4.7.7',
      history: '4.10.1',
      'html-escaper': '^3.0.3',
      'html-minifier': '4.0.0',
      'http-proxy-middleware': '^2.0.6',
      i18next: '^23.8.2',
      'i18next-resources-to-backend': '^1.2.0',
      'inline-style-parser': '^0.1.1',
      inversify: '^6.0.1',
      'inversify-react': '^1.1.0',
      'js-cookie': '^3.0.5',
      jsdom: '~20.0.3',
      'json-as-xlsx': '^2.5.5',
      jsonwebtoken: '^8.5.1',
      keymachine: '^2.1.0',
      lighthouse: '^9.6.8',
      lit: '^3.1.2',
      lodash: '^4.17.21',
      lokijs: '^1.5.12',
      'lru-cache': '^10.0.1',
      'lucide-react': '^0.263.1',
      'mime-types': '^2.1.35',
      mobx: '^6.6.2',
      'mobx-react': '^7.6.0',
      mockdate: '^3.0.5',
      moment: '^2.13.0',
      ms: '^2.1.3',
      nanoid: '^4.0.2',
      'nestjs-zod': '^2.3.2',
      next: '^14.0.3',
      'next-auth': '^4.24.5',
      'next-contentlayer': '^0.3.4',
      'node-fetch': '^2.7.0',
      'node-html-parser': '^6.1.5',
      nodemailer: '^6.8.0',
      nx: '15.9.7',
      'openapi3-ts': '^2.0.0 || ^3.0.0',
      'p-limit': '^3.0.0',
      passport: '^0.6.0',
      'passport-custom': '^1.1.1',
      'passport-jwt': '^4.0.1',
      'passport-local': '^1.0.0',
      'pinyin-pro': '^3.19.3',
      pluralize: '^8.0.0',
      polished: '^4.2.2',
      prisma: '^4.16.2',
      'prisma-dbml-generator': '^0.10.0',
      'prop-types': '^15.5.0',
      punycode: '^2.3.0',
      puppeteer: '^21.0.2',
      qs: '^6.11.2',
      radash: '^11.0.0',
      react: '18.2.0',
      'react-arborist': '^3.4.0',
      'react-circular-progressbar': '^2.1.0',
      'react-colorful': '^5.6.1',
      'react-dom': '18.2.0',
      'react-dom-confetti': '^0.2.0',
      'react-highlight-words': '^0.20.0',
      'react-i18next': '^14.0.1',
      'react-imask': '^7.1.3',
      'react-is': '18.2.0',
      'react-js-cron': '^3.2.0',
      'react-markdown': '^8.0.7',
      'react-medium-image-zoom': '^5.1.7',
      'react-parallax-tilt': '^1.7.70',
      'react-refresh': '^0.10.0',
      'react-router-dom': '5.3.4',
      'react-spring': '^9.5.5',
      'react-test-renderer': '18.2.0',
      'react-textarea-autosize': '^8.4.0',
      'react-tweet': '^3.1.1',
      'reflect-metadata': '^0.1.13',
      'regenerator-runtime': '0.13.7',
      'rehype-autolink-headings': '^6.1.1',
      'rehype-pretty-code': '^0.9.5',
      'rehype-slug': '^5.1.0',
      'remark-gfm': '^3.0.1',
      remeda: '^1.29.0',
      resend: '^0.17.1',
      rxjs: '^7.0.0',
      sharp: '^0.30.7',
      shiki: '^0.14.1',
      sonner: '^0.5.0',
      stripe: '^12.12.0',
      'styled-components': '5.3.6',
      swr: '^2.1.5',
      'tailwind-merge': '^1.13.2',
      'tencentcloud-sdk-nodejs': '^4.0.789',
      'theme-ui': '^0.15.5',
      'topojson-client': '^3.1.0',
      'trpc-panel': '^1.3.4',
      'ts-deepmerge': '^6.2.0',
      tslib: '^2.3.0',
      typescript: '^5.1.6',
      'unsplash-js': '^7.0.18',
      'use-debounce': '^8.0.4',
      uuid: '^9.0.1',
      vaul: '^0.0.6',
      webpack: '^5.75.0',
      'webpack-merge': '^5.8.0',
      'wechat-oauth': '^1.5.0',
      'wechatpay-node-v3': '^2.0.6',
      yaml: '^2.4.0',
      yargs: '^17.7.2',
      yup: '^1.3.3',
      znv: '^0.4.0',
      zod: '3.21.1',
      'zod-formik-adapter': '^1.2.0',
      'zod-prisma-types': 'file:.yalc/zod-prisma-types',
      zx: '^7.1.1',
      'zod-openapi': '2.14.0'
    },
    devDependencies: {
      '@babel/core': '7.12.13',
      '@babel/plugin-proposal-class-properties': '^7.18.6',
      '@babel/plugin-proposal-decorators': '^7.21.0',
      '@babel/preset-react': '^7.14.5',
      '@babel/preset-typescript': '7.12.13',
      '@faker-js/faker': '^8.0.2',
      '@nrwl/cli': '15.9.7',
      '@nrwl/cypress': '15.9.7',
      '@nrwl/devkit': '15.9.7',
      '@nrwl/esbuild': '15.9.7',
      '@nrwl/eslint-plugin-nx': '15.9.7',
      '@nrwl/jest': '15.9.7',
      '@nrwl/js': '15.9.7',
      '@nrwl/linter': '15.9.7',
      '@nrwl/nest': '15.9.7',
      '@nrwl/node': '15.9.7',
      '@nrwl/nx-cloud': '16.3.0',
      '@nrwl/react': '15.9.7',
      '@nrwl/storybook': '15.9.7',
      '@nrwl/vite': '15.9.7',
      '@nrwl/web': '15.9.7',
      '@nrwl/webpack': '15.9.7',
      '@nrwl/workspace': '15.9.7',
      '@react-email/components': '^0.0.7',
      '@rollup/plugin-alias': '^5.1.0',
      '@storybook/addon-essentials': '7.2.1',
      '@storybook/addon-interactions': '7.2.1',
      '@storybook/builder-webpack5': '7.2.1',
      '@storybook/core-server': '7.2.1',
      '@storybook/jest': '^0.2.2',
      '@storybook/manager-webpack5': '^6.5.16',
      '@storybook/react': '7.2.1',
      '@storybook/react-vite': '7.2.1',
      '@storybook/test-runner': '^0.13.0',
      '@storybook/testing-library': '^0.2.0',
      '@swc/core': '^1.2.173',
      '@swc/jest': '0.2.20',
      '@tailwindcss/forms': '^0.5.3',
      '@tailwindcss/typography': '^0.5.9',
      '@trivago/prettier-plugin-sort-imports': '^4.0.0',
      '@types/bcrypt': '^5.0.0',
      '@types/cookie-parser': '^1.4.3',
      '@types/crypto-js': '^4.1.1',
      '@types/express': '^4.17.17',
      '@types/express-serve-static-core': '^4.17.43',
      '@types/express-session': '^1.17.5',
      '@types/fs-extra': '^11.0.1',
      '@types/history': '4.7.11',
      '@types/html-escaper': '^3.0.0',
      '@types/jest': '28.1.1',
      '@types/jest-when': '^3.5.2',
      '@types/json-schema': '^7.0.11',
      '@types/jsonwebtoken': '^8.5.9',
      '@types/lodash': '^4.14.186',
      '@types/lokijs': '^1.5.7',
      '@types/mime-types': '^2.1.4',
      '@types/ms': '^0.7.31',
      '@types/multer': '1.4.11',
      '@types/node': '18.11.9',
      '@types/nodemailer': '^6.4.6',
      '@types/passport-jwt': '^3.0.8',
      '@types/passport-local': '^1.0.35',
      '@types/pluralize': '^0.0.29',
      '@types/qs': '^6.9.7',
      '@types/react': '^18.2.34',
      '@types/react-dom': '^18.2.14',
      '@types/react-highlight-words': '^0.16.4',
      '@types/react-is': '17.0.3',
      '@types/react-router-dom': '5.3.3',
      '@types/rebass__grid': '^6.0.10',
      '@types/reflexbox': '^4.0.5',
      '@types/sinon': '^10.0.16',
      '@types/styled-components': '5.1.26',
      '@types/topojson-client': '^3.1.1',
      '@types/yargs': '^17.0.24',
      '@typescript-eslint/eslint-plugin': '^6.19.0',
      '@typescript-eslint/parser': '^6.19.0',
      '@vitejs/plugin-react': '^4.0.0',
      '@vitest/coverage-c8': '~0.33.0',
      '@vitest/ui': '^0.34.0',
      'array-to-ndjson': '^1.0.1',
      autoprefixer: '^10.4.13',
      'babel-jest': '28.1.1',
      'babel-loader': '8.1.0',
      'babel-plugin-styled-components': '1.10.7',
      chokidar: '^3.5.3',
      concurrently: '^8.0.1',
      'copy-webpack-plugin': '^12.0.2',
      'css-loader': '^6.4.0',
      esbuild: '^0.17.5',
      eslint: '~8.15.0',
      'eslint-config-prettier': '8.1.0',
      'eslint-plugin-cypress': '^2.10.3',
      'eslint-plugin-import': '2.26.0',
      'eslint-plugin-jsx-a11y': '6.6.1',
      'eslint-plugin-react': '7.31.11',
      'eslint-plugin-react-hooks': '4.6.0',
      jest: '28.1.1',
      'jest-environment-jsdom': '28.1.1',
      'jest-environment-node': '28.1.1',
      'jest-junit': '^14.0.1',
      'jest-mock-extended': '2.0.4',
      'jest-when': '^3.5.2',
      'node-watch': '^0.7.4',
      playwright: '^1.37.1',
      postcss: '^8.4.19',
      'postcss-import': '^15.1.0',
      'postcss-url': '^10.1.3',
      prettier: '^2.8.0',
      'prettier-plugin-tailwindcss': '^0.1.13',
      'prisma-trpc-generator': '^1.4.1',
      'react-email': '^1.9.4',
      rollup: '^4.9.4',
      'rollup-plugin-dts': '^6.1.0',
      'rollup-plugin-ts': '^3.4.5',
      'rollup-plugin-tsconfig-paths': '^1.5.2',
      sinon: '^16.0.0',
      'storybook-addon-swc': '^1.1.7',
      'storybook-react-context': '^0.6.0',
      'style-loader': '^3.3.0',
      supertest: '^6.3.1',
      'swc-loader': '0.1.15',
      'tailwind-scrollbar-hide': '^1.1.7',
      tailwindcss: '^3.3.2',
      'tailwindcss-radix': '^2.8.0',
      'ts-jest': '28.0.5',
      'ts-node': '10.9.1',
      'url-loader': '^4.1.1',
      vite: '4.0.1',
      'vite-plugin-commonjs': '^0.10.1',
      'vite-plugin-dts': '^3.5.3',
      'vite-plugin-eslint': '^1.8.1',
      'vite-plugin-static-copy': '^1.0.0',
      'vite-tsconfig-paths': '^4.2.0',
      vitest: '^0.34.3',
      'vitest-mock-extended': '^1.1.4',
      xlsx: '^0.18.5',
      'api-spec-converter': '^2.12.0'
    }
  },
  fs: { numberOfFiles: 17 },
  debug: [
    '2024-03-28T03:21:05.479Z project waiting for initial run signal\n',
    '2024-03-28T03:21:05.490Z config Attempting automatic configuration for vitest\n',
    '2024-03-28T03:21:05.492Z vitest/config Detected Vitest (0.34.3).\n',
    '2024-03-28T03:21:06.172Z config Finished attempting automatic configuration for vitest (682ms)\n',
    '2024-03-28T03:21:06.174Z project Wallaby Node version: v18.19.0\n',
    '2024-03-28T03:21:06.174Z project Wallaby config: <homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/wallaby.js\n',
    '2024-03-28T03:21:06.228Z fs File system starting\n',
    '2024-03-28T03:21:06.255Z fs File system scan completed\n',
    '2024-03-28T03:21:06.260Z project File cache: <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.374/projects/957b6d9721ef35bf\n',
    '2024-03-28T03:21:06.269Z uiService Listening port 51236\n',
    '2024-03-28T03:21:06.270Z project package.json file change detected, invalidating local cache\n',
    '2024-03-28T03:21:06.277Z workers Parallelism for initial run: 1, for regular run: 1\n',
    '2024-03-28T03:21:06.277Z workers Starting run worker instance #0\n',
    '2024-03-28T03:21:06.278Z workers Web server is listening at 56388\n',
    '2024-03-28T03:21:06.278Z project File cache requires some updates, waiting required files from IDE\n',
    '2024-03-28T03:21:06.355Z project Stopping process pool\n',
    '2024-03-28T03:21:06.357Z project Test run started; run priority: 3\n',
    '2024-03-28T03:21:06.358Z project Running all tests\n',
    '2024-03-28T03:21:06.359Z workers Starting test run, priority: 3\n',
    '2024-03-28T03:21:06.360Z nodeRunner Starting sandbox [worker #0, session #ni1ge]\n',
    '2024-03-28T03:21:06.360Z nodeRunner Preparing sandbox [worker #0, session #ni1ge]\n',
    '2024-03-28T03:21:06.473Z workers Started run worker instance (delayed) #0\n',
    '2024-03-28T03:21:06.474Z nodeRunner Prepared sandbox [worker #0, session #ni1ge]\n',
    '2024-03-28T03:21:06.474Z workers [worker #0, session #ni1ge] Running tests in sandbox\n',
    "2024-03-28T03:21:07.147Z workers 'Scheduling Vitest Run (ni1ge): 2024-03-28T03:21:07.147Z'\n",
    '2024-03-28T03:21:07.855Z workers [ni1ge.2] Loaded unknown number of test(s)\n',
    '2024-03-28T03:21:07.856Z workers Sandbox (active) [ni1ge] error: ReferenceError: describe is not defined\n' +
      '    at ./libs/cms-admin-services/src/utils/py.spec.ts:3:1\n' +
      '    at VitestExecutor.runModule (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:342:5)\n' +
      '    at VitestExecutor.directRequest (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:326:5)\n' +
      '    at VitestExecutor.cachedRequest (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:189:14)\n' +
      '    at VitestExecutor.executeId (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:165:12)\n' +
      '    at collectTestsPatched (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:461:7)\n' +
      '    at collectTests (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:440:61)\n' +
      '    at startTests (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:789:17)\n' +
      '    at file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:100:7\n' +
      '    at withEnv (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:70:5)\n' +
      '    at run (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:92:3)\n' +
      '    at run (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/worker.js:87:5)\n' +
      '    at file://./node_modules/.pnpm/tinypool@0.7.0/node_modules/tinypool/dist/esm/worker.js:109:20ReferenceError: describe is not defined\n' +
      '    at ./libs/cms-admin-services/src/utils/py.spec.ts:3:1\n' +
      '    at VitestExecutor.runModule (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:342:5)\n' +
      '    at VitestExecutor.directRequest (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:326:5)\n' +
      '    at VitestExecutor.cachedRequest (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:189:14)\n' +
      '    at VitestExecutor.executeId (file://./node_modules/.pnpm/vite-node@0.34.3_pijbvk6im7i4n6lane5empynnq/node_modules/vite-node/dist/client.mjs:165:12)\n' +
      '    at collectTestsPatched (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:461:7)\n' +
      '    at collectTests (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:440:61)\n' +
      '    at startTests (file://./node_modules/.pnpm/@vitest+runner@0.34.3/node_modules/@vitest/runner/dist/index.js:789:17)\n' +
      '    at file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:100:7\n' +
      '    at withEnv (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:70:5)\n' +
      '    at run (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/entry.js:92:3)\n' +
      '    at run (file://./node_modules/.pnpm/vitest@0.34.3_dopxylbtozt7wffnj6tpkv4iaq/node_modules/vitest/dist/worker.js:87:5)\n' +
      '    at file://./node_modules/.pnpm/tinypool@0.7.0/node_modules/tinypool/dist/esm/worker.js:109:20\n',
    '2024-03-28T03:21:07.881Z workers Sandbox (active) [ni1ge] error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?\n' +
      '    at loadAndTransform (file://./node_modules/.pnpm/vite@4.0.1_pijbvk6im7i4n6lane5empynnq/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:40373:21)\n',
    '2024-03-28T03:21:07.881Z workers Sandbox (active) [ni1ge] error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?\n' +
      '    at loadAndTransform (file://./node_modules/.pnpm/vite@4.0.1_pijbvk6im7i4n6lane5empynnq/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:40373:21)\n',
    '2024-03-28T03:21:07.882Z workers [ni1ge.1] Loaded unknown number of test(s)\n',
    "2024-03-28T03:21:07.900Z workers 'Vitest Run Complete (ni1ge): 2024-03-28T03:21:07.899Z'\n",
    '2024-03-28T03:21:07.900Z workers [ni1ge] Run 0 test(s), skipped 0 test(s)\n',
    '2024-03-28T03:21:07.901Z workers [ni1ge] Sandbox is responsive, closing it\n',
    '2024-03-28T03:21:07.902Z workers Failed to map the stack to user code, entry message: Error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?, stack: Error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?\n' +
      '    at loadAndTransform (file://<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.pnpm/vite@4.0.1_pijbvk6im7i4n6lane5empynnq/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:40373:21)\n',
    '2024-03-28T03:21:07.902Z workers Failed to map the stack to user code, entry message: Error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?, stack: Error: Failed to load url @flowda-projects/flowda-shared-types (resolved id: @flowda-projects/flowda-shared-types). Does the file exist?\n' +
      '    at loadAndTransform (file://<homeDir>/Projects/XProjects/flowda-solutions/flowda-projects/node_modules/.pnpm/vite@4.0.1_pijbvk6im7i4n6lane5empynnq/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:40373:21)\n',
    '2024-03-28T03:21:07.903Z project Test run finished\n',
    '2024-03-28T03:21:07.903Z project Processed console.log entries\n',
    '2024-03-28T03:21:07.903Z project Processed loading sequences\n',
    '2024-03-28T03:21:07.903Z project Processed executed tests\n',
    '2024-03-28T03:21:07.904Z project Processed code coverage\n',
    '2024-03-28T03:21:07.914Z project Test run result processed and sent to IDE\n'
  ]
}
smcenlly commented 8 months ago

Since you have both vitest and jest installed for your project, Wallaby tries to use vitest first, and you'll receive the error that you describe.

You can create a Wallaby configuration file and tell Wallaby to only attempt to start using Jest. For example:

module.exports = ({
  // Only attempt to start using Jest
  autoDetect: ['jest']
});

If your jest is configured within your NX workspace configuration (vs. using jest.config.js file), then you will need to tell Wallaby to use Angular as the auto-detect setting. NX was originally an offshoot of angular and it remains that way in Wallaby's internally processing:

module.exports = ({
  // Only attempt to start using Angular/NX workspaces
  autoDetect: ['angular']
});
shanehsi commented 8 months ago

Thank for your quick response. I already set autoDetect to Jest ( see the diagnostics up), and angular by your advice.

It worked before, but seems that it's no longer working.

module.exports = function (wallaby) {
  return {
    // Tell Wallaby to only try configuring with vitest
    // Default is: ['angular', 'jest', 'vitest']
    autoDetect: ['angular'],

    // Limit how many processes Wallaby will use, for example:
    // 1 process for incremental runs, 2 processes at startup
    workers: { regular: 1, initial: 2 },

    // modify `files` automatic configuration settings
    files: {
      override: filePatterns => {
        // TODO: modify `filePatterns` array as required
        // return filePatterns;
        return ['libs/cms-admin-services/src/**/*.ts', '!libs/cms-admin-services/src/**/*.spec.ts']
      },
    },

    // modify `tests` automatic configuration settings
    tests: {
      override: testPatterns => {
        // TODO: modify `testPatterns` array as required
        // return testPatterns;
        return ['libs/cms-admin-services/src/**/*.spec.ts']
      },
    },
  }
}
smcenlly commented 8 months ago

Thanks for letting us know. This was a regression (bug) that we introduced last week.

This is fixed in the latest version of Wallaby core, v1.0.1549. Please run the VS Code command, Wallaby.js: Force Core Update, it should update to the latest version and work for you.

shanehsi commented 8 months ago

Thanks very much, you saved my day!.