wallabyjs / public

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

Wallaby do not support vitest environment #3184

Closed polRk closed 1 year ago

polRk commented 1 year ago

Issue description or question

When trying to run tests with a custom environment, I get a ReferenceError that I don't get when I run it through vitest.

My current vitest setup

/// <reference types="vitest" />
import { defineConfig } from 'vite'

const isCI = process.env['CI'] === 'true'

export default defineConfig({
    cacheDir: '../../node_modules/.vite/proxy',

    test: {
        environment: 'miniflare',
        environmentOptions: {
            modules: true,
            scriptPath: './src/index.ts',
            mounts: {
                api: {
                    rootPath: '../api',
                },
            },
        },
        watch: false,
        cache: {
            dir: '../../node_modules/.vitest',
        },
        include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
        silent: isCI,
        reporters: isCI ? 'tap' : 'default',
        coverage: {
            clean: true,
            enabled: isCI,
            reporter: isCI ? ['lcov', 'json-summary', 'text-summary'] : 'text',
        },
    },
})

Usage


const describe = setupMiniflareIsolatedStorage() // ​​[Error] Runtime error: ReferenceError: setupMiniflareIsolatedStorage is not defined​​

Wallaby diagnostics report

{
  editorVersion: '1.75.1',
  pluginVersion: '1.0.350',
  editorType: 'VSCode',
  osVersion: 'darwin 22.3.0',
  nodeVersion: 'v18.15.0',
  coreVersion: '1.0.1396',
  checksum: 'YzhmY2QyYTM2OTZiNWU5ZTlmYWI1YzI3NTg1ODhmNzYsMTcwMzM3NjAwMDAwMCww',
  config: {
    diagnostics: {
      vitest: {
        config: {
          allowOnly: true,
          watch: true,
          globals: false,
          environment: 'node',
          threads: true,
          clearMocks: false,
          restoreMocks: false,
          mockReset: false,
          include: [ '**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}' ],
          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,
          ui: false,
          uiBase: '/__vitest__/',
          open: true,
          css: { include: [], modules: { classNameStrategy: 'stable' } },
          coverage: {
            provider: 'c8',
            enabled: false,
            clean: true,
            cleanOnRerun: true,
            reportsDirectory: './coverage',
            exclude: [
              'coverage/**',
              'dist/**',
              'packages/*/test{,s}/**',
              '**/*.d.ts',
              'cypress/**',
              'test{,s}/**',
              'test{,-*}.{js,cjs,mjs,ts,tsx,jsx}',
              '**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}',
              '**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}',
              '**/__tests__/**',
              '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
              '**/.{eslint,mocha,prettier}rc.{js,cjs,yml}'
            ],
            reporter: [ 'text', 'html', 'clover', 'json' ],
            extension: [
              '.js',  '.cjs',
              '.mjs', '.ts',
              '.mts', '.cts',
              '.tsx', '.jsx',
              '.vue', '.svelte'
            ]
          },
          fakeTimers: { loopLimit: 10000, shouldClearNativeTimers: true, toFake: [ 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate', 'Date' ] },
          maxConcurrency: 5,
          dangerouslyIgnoreUnhandledErrors: false,
          typecheck: {
            checker: 'tsc',
            include: [ '**/*.{test,spec}-d.{ts,js}' ],
            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>/Developer/github.com/glocal/gloc.al',
          mode: [],
          deps: { inline: [ {}, {}, {}, '@nuxt/test-utils' ], registerNodeLoader: false },
          snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new' },
          setupFiles: [],
          cache: { dir: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/.vitest' },
          sequence: { hooks: 'parallel' },
          environmentMatchGlobs: [],
          package: {
            version: '0.28.5',
            urls: { hooks: 'file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/runners/node/hooks.mjs' },
            paths: { root: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/vitest', dist: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/vitest/dist' }
          }
        }
      }
    },
    testFramework: { version: 'vitest@0.14.0', configurator: 'vitest@0.14.0', reporter: 'vitest@0.14.0', starter: 'vitest@0.14.0', autoDetected: true },
    preserveComments: false,
    extractComments: true,
    files: [
      { pattern: '**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', ignore: true, trigger: true, load: true, file: true },
      { pattern: '**/node_modules/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/dist/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/cypress/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/.{idea,git,cache,output,temp}/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/*.*', ignore: false, trigger: true, load: true, order: 1 }
    ],
    tests: [
      { pattern: '**/node_modules/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/dist/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/cypress/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/.{idea,git,cache,output,temp}/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', ignore: false, trigger: true, load: true, test: true, order: 2 }
    ],
    workers: { initial: 1, regular: 1, recycle: false },
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: {},
    logLimits: { inline: { depth: 5, elements: 5000 }, values: { default: { stringLength: 200 }, 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/',
      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: '--experimental-loader=file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/runners/node/hooks.mjs' },
      runner: '/opt/homebrew/Cellar/node@18/18.15.0/bin/node',
      viewportSize: { width: 800, height: 600 },
      options: { width: 800, height: 600 },
      bundle: true
    },
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    runAllTestsWhenNoAffectedTests: true,
    symlinkNodeModules: true,
    configCode: 'auto.detect#-927380447'
  },
  packageJSON: {
    dependencies: undefined,
    devDependencies: {
      '@commitlint/cli': '17.4.4',
      '@commitlint/config-conventional': '17.4.4',
      '@miniflare/shared-test-environment': '2.12.1',
      '@typescript-eslint/eslint-plugin': '5.53.0',
      '@typescript-eslint/parser': '5.53.0',
      '@vitest/coverage-c8': '0.28.5',
      esbuild: '0.17.10',
      eslint: '8.35.0',
      'eslint-config-prettier': '8.7.0',
      'eslint-import-resolver-typescript': '3.5.3',
      'eslint-plugin-import': '2.27.5',
      'eslint-plugin-jsonc': '2.6.0',
      'eslint-plugin-sonarjs': '0.18.0',
      husky: '8.0.3',
      'lint-staged': '13.1.2',
      miniflare: '2.12.1',
      'npm-run-all': '4.1.5',
      prettier: '2.8.4',
      typescript: '4.9.5',
      vite: '4.1.4',
      'vite-tsconfig-paths': '4.0.5',
      vitest: '0.28.5',
      'vitest-environment-miniflare': '2.12.1',
      wrangler: '2.12.0'
    }
  },
  fs: { numberOfFiles: 216 },
  debug: [
    '2023-03-14T20:58:58.258Z config Attempting automatic configuration for angular\n',
    '2023-03-14T20:58:58.260Z angular/cli config Angular CLI not found.\n',
    '2023-03-14T20:58:58.260Z config Finished attempting automatic configuration for angular (3ms)\n',
    '2023-03-14T20:58:58.260Z config Attempting automatic configuration for jest\n',
    "2023-03-14T20:58:58.261Z jest/config Error: Module jest-cli is not found in '<homeDir>/Developer/github.com/glocal/gloc.al'.\n" +
      '    at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:32:410)\n' +
      '    at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:31:15506)\n' +
      '    at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:31:14801)\n' +
      '    at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:31:14710\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:31:14504)\n' +
      '    at Object.loadJest (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:31:30038)\n' +
      '    at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:26907\n' +
      '    at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:31640)\n' +
      '    at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30935)\n' +
      '    at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30844\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30638)\n' +
      '    at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:26595)\n' +
      '    at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30315)\n' +
      '    at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:31640)\n' +
      '    at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30935)\n' +
      '    at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30844\n' +
      '    at new Promise (<anonymous>)\n' +
      '    at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30638)\n' +
      '    at Object.n [as configure] (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:19:30196)\n' +
      '    at Config.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:15:23317)\n' +
      '    at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:15:14538)\n' +
      '    at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:15:13833)\n' +
      '    at o (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/server.js:15:13582)\n',
    '2023-03-14T20:58:58.261Z config Finished attempting automatic configuration for jest (1ms)\n',
    '2023-03-14T20:58:58.261Z config Attempting automatic configuration for vitest\n',
    '2023-03-14T20:58:58.262Z vitest/config Detected Vitest (0.28.5).\n',
    '2023-03-14T20:58:58.610Z config Finished attempting automatic configuration for vitest (349ms)\n',
    '2023-03-14T20:58:58.610Z project Wallaby Node version: v18.15.0\n',
    '2023-03-14T20:58:58.610Z project Wallaby config: <homeDir>/Developer/github.com/glocal/gloc.al/auto.detect\n',
    '2023-03-14T20:58:58.617Z fs File system starting\n',
    '2023-03-14T20:58:58.650Z fs File system scan completed\n',
    '2023-03-14T20:58:58.654Z project File cache: <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/projects/c7bc350c0009d41e\n',
    '2023-03-14T20:58:58.702Z uiService Listening port 51235\n',
    '2023-03-14T20:58:58.709Z workers Parallelism for initial run: 1, for regular run: 1\n',
    '2023-03-14T20:58:58.709Z workers Starting run worker instance #0\n',
    '2023-03-14T20:58:58.717Z workers Web server is listening at 57081\n',
    '2023-03-14T20:58:58.720Z project Stopping process pool\n',
    '2023-03-14T20:58:58.720Z project File cache is up-to-date, starting full test run\n',
    '2023-03-14T20:58:58.721Z project Test run started; run priority: 3\n',
    '2023-03-14T20:58:58.721Z project Running all tests\n',
    '2023-03-14T20:58:58.724Z workers Starting test run, priority: 3\n',
    '2023-03-14T20:58:58.724Z nodeRunner Starting sandbox [worker #0, session #czaa3]\n',
    '2023-03-14T20:58:58.724Z nodeRunner Preparing sandbox [worker #0, session #czaa3]\n',
    '2023-03-14T20:58:58.845Z workers Started run worker instance (delayed) #0\n',
    '2023-03-14T20:58:58.845Z nodeRunner Prepared sandbox [worker #0, session #czaa3]\n',
    '2023-03-14T20:58:58.845Z workers [worker #0, session #czaa3] Running tests in sandbox\n',
    '2023-03-14T20:58:59.033Z workers Scheduling Vitest Run (czaa3): 2023-03-14T20:58:59.020Z\n',
    '2023-03-14T20:58:59.471Z workers [czaa3.7] Loaded unknown number of test(s)\n',
    '2023-03-14T20:58:59.474Z workers [czaa3.4] Loaded unknown number of test(s)\n',
    '2023-03-14T20:58:59.482Z workers [czaa3.7] Test executed: should render open and close tags\n',
    '2023-03-14T20:58:59.485Z workers [czaa3.4] Test executed: should return random uuid v4 string\n',
    '2023-03-14T20:58:59.486Z workers [czaa3.7] Test executed: should render attributes\n',
    '2023-03-14T20:58:59.490Z workers [czaa3.5] Loaded unknown number of test(s)\n',
    '2023-03-14T20:58:59.506Z workers [czaa3.7] Test executed: should escape double quote in attribute value\n',
    '2023-03-14T20:58:59.521Z workers [czaa3.5] Test executed: should return success result\n',
    '2023-03-14T20:58:59.525Z workers [czaa3.7] Test executed: should stringify attribute value\n',
    '2023-03-14T20:58:59.525Z workers [czaa3.3] Loaded unknown number of test(s)\n',
    '2023-03-14T20:58:59.527Z workers [czaa3.5] Test executed: should throw an error if invalid\n',
    '2023-03-14T20:58:59.529Z workers [czaa3.7] Test executed: should render body\n',
    '2023-03-14T20:58:59.531Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.533Z workers [czaa3.5] Test executed: should throw an error if protocol exists\n',
    '2023-03-14T20:58:59.539Z workers [czaa3.3] Test executed: should return true for mime-type text/html\n',
    '2023-03-14T20:58:59.539Z workers [czaa3.5] Test executed: should throw an error if port exists\n',
    '2023-03-14T20:58:59.543Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.551Z workers [czaa3.3] Test executed: should return true for mime-type text/css\n',
    '2023-03-14T20:58:59.552Z workers Sandbox (active) [czaa3] error: ReferenceError: setupMiniflareIsolatedStorage is not defined\n' +
      '    at ./apps/proxy/src/html-rewriters/extractor.test.ts:17:19\n' +
      '    at VitestExecutor.directRequest (file://./node_modules/vite-node/dist/client.mjs:312:5)\n' +
      '    at VitestExecutor.cachedRequest (file://./node_modules/vite-node/dist/client.mjs:156:14)\n' +
      '    at VitestExecutor.executeId (file://./node_modules/vite-node/dist/client.mjs:137:12)\n' +
      '    at collectTests (file://./node_modules/@vitest/runner/dist/index.js:297:7)\n' +
      '    at startTests (file://./node_modules/@vitest/runner/dist/index.js:586:17)\n' +
      '    at file://./node_modules/vitest/dist/entry.js:298:11\n' +
      '    at withEnv (file://./node_modules/vitest/dist/entry.js:196:5)\n' +
      '    at run (file://./node_modules/vitest/dist/entry.js:291:7)\n' +
      '    at file://./node_modules/tinypool/dist/esm/worker.js:109:20\n',
    '2023-03-14T20:58:59.553Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.555Z workers [czaa3.3] Test executed: should return true for mime-type text/javascript\n',
    '2023-03-14T20:58:59.560Z workers [czaa3.3] Test executed: should return true for mime-type text/ecmascript\n',
    '2023-03-14T20:58:59.574Z workers [czaa3.3] Test executed: should return true for mime-type application/javascript\n',
    '2023-03-14T20:58:59.579Z workers [czaa3.3] Test executed: should return true for mime-type application/ecmascript\n',
    '2023-03-14T20:58:59.587Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.592Z workers [czaa3.3] Test executed: should return true for mime-type application/manifest+json\n',
    '2023-03-14T20:58:59.594Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.596Z workers [czaa3.3] Test executed: should return true for mime-type image/jpg\n',
    '2023-03-14T20:58:59.599Z workers [czaa3.3] Test executed: should return true for mime-type image/png\n',
    '2023-03-14T20:58:59.602Z workers [czaa3.3] Test executed: should return true for mime-type image/avif\n',
    '2023-03-14T20:58:59.602Z workers [czaa3.3] Test executed: should return true for mime-type image/heic\n',
    '2023-03-14T20:58:59.602Z workers [czaa3.3] Test executed: should return true for mime-type image/heif\n',
    '2023-03-14T20:58:59.604Z workers [czaa3.3] Test executed: should return true for mime-type image/svg+xml\n',
    '2023-03-14T20:58:59.607Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.609Z workers [czaa3.3] Test executed: should return true for mime-type font/collection\n',
    '2023-03-14T20:58:59.609Z workers [czaa3.3] Test executed: should return true for mime-type font/otf\n',
    '2023-03-14T20:58:59.611Z workers [czaa3.3] Test executed: should return true for mime-type font/sfnt\n',
    '2023-03-14T20:58:59.615Z workers [czaa3.3] Test executed: should return true for mime-type font/ttf\n',
    '2023-03-14T20:58:59.615Z workers [czaa3.3] Test executed: should return true for mime-type font/woff\n',
    '2023-03-14T20:58:59.616Z workers [czaa3.3] Test executed: should return true for mime-type font/woff2\n',
    '2023-03-14T20:58:59.617Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.619Z workers [czaa3.3] Test executed: should return true for mime-type video/mp4\n',
    '2023-03-14T20:58:59.620Z workers [czaa3.3] Test executed: should return true for mime-type video/AV1\n',
    '2023-03-14T20:58:59.621Z workers [czaa3.3] Test executed: should return true for mime-type video/H264\n',
    '2023-03-14T20:58:59.621Z workers [czaa3.3] Test executed: should return true for mime-type video/H265\n',
    '2023-03-14T20:58:59.622Z workers [czaa3.3] Test executed: should return true for mime-type video/H266\n',
    '2023-03-14T20:58:59.626Z workers [czaa3.3] Test executed: should return false if header Content-Type is not exsits\n',
    '2023-03-14T20:58:59.627Z workers [czaa3.3] Test executed: should return true for mime-type audio/aac\n',
    '2023-03-14T20:58:59.628Z workers [czaa3.3] Test executed: should return true for mime-type audio/ac3\n',
    '2023-03-14T20:58:59.630Z workers [czaa3.1] Loaded unknown number of test(s)\n',
    '2023-03-14T20:58:59.632Z workers [czaa3.3] Test executed: should return true for mime-type audio/ogg\n',
    '2023-03-14T20:58:59.639Z workers [czaa3.3] Test executed: should return true for mime-type audio/mp4\n',
    '2023-03-14T20:58:59.656Z workers [czaa3] Run 46 test(s), skipped 0 test(s)\n',
    '2023-03-14T20:58:59.688Z workers [czaa3] Sandbox is responsive, closing it\n',
    '2023-03-14T20:58:59.691Z project Test run finished\n',
    '2023-03-14T20:58:59.692Z project Processed console.log entries\n',
    '2023-03-14T20:58:59.692Z project Processed loading sequences\n',
    '2023-03-14T20:58:59.692Z project Processed executed tests\n',
    '2023-03-14T20:58:59.694Z project Processed code coverage\n',
    '2023-03-14T20:58:59.708Z project Test run result processed and sent to IDE\n',
    '2023-03-14T20:58:59.709Z workers Sandbox (inactive) [czaa3] error: ReferenceError: setupMiniflareIsolatedStorage is not defined\n' +
      '    at ./apps/proxy/src/html-rewriters/replacer.test.ts:15:19\n' +
      '    at VitestExecutor.directRequest (file://./node_modules/vite-node/dist/client.mjs:312:5)\n' +
      '    at VitestExecutor.cachedRequest (file://./node_modules/vite-node/dist/client.mjs:156:14)\n' +
      '    at VitestExecutor.executeId (file://./node_modules/vite-node/dist/client.mjs:137:12)\n' +
      '    at collectTests (file://./node_modules/@vitest/runner/dist/index.js:297:7)\n' +
      '    at startTests (file://./node_modules/@vitest/runner/dist/index.js:586:17)\n' +
      '    at file://./node_modules/vitest/dist/entry.js:298:11\n' +
      '    at withEnv (file://./node_modules/vitest/dist/entry.js:196:5)\n' +
      '    at run (file://./node_modules/vitest/dist/entry.js:291:7)\n' +
      '    at file://./node_modules/tinypool/dist/esm/worker.js:109:20\n',
    '2023-03-14T20:59:00.035Z fs No metadata for added file found: node_modules/.vitest/results.json\n',
    '2023-03-14T20:59:04.665Z workers Some long running code has been detected: one of your tests is taking more than 5000ms to execute.\n',
    '2023-03-14T20:59:04.685Z workers Some long running code has been detected: one of your files is taking more than 5000ms to execute.\n' +
      'Execution of the following files has started but has not finished:\n' +
      '- apps/proxy/src/html-rewriters/replacer.test.ts\n' +
      'Try commenting out the test or excluding the test file from the `tests` list in your wallaby config,\n' +
      'and restarting wallaby to make sure that it is this test/file causing the issue and not something else.\n' +
      'Pinging test runner sandbox...\n',
    '2023-03-14T20:59:04.686Z workers Sandbox is responsive. The issue may be asynchronous in nature (for example, a missing callback).\n',
    '2023-03-14T20:59:08.142Z fs File changed: node_modules/.vitest/results.json\n',
    '2023-03-14T20:59:08.142Z fs No metadata for changed file found: node_modules/.vitest/results.json\n',
    '2023-03-14T21:01:04.622Z fs No metadata for added file found: node_modules/vite/bin/vite.js\n',
    '2023-03-14T21:02:38.532Z fs No metadata for added file found: .git/FETCH_HEAD\n',
    '2023-03-14T21:02:40.480Z fs File changed: .git/FETCH_HEAD\n',
    '2023-03-14T21:02:40.480Z fs No metadata for changed file found: .git/FETCH_HEAD\n'
  ]
}
polRk commented 1 year ago

With Automatic Configuration all works

smcenlly commented 1 year ago

Unfortunately we could not reproduce your problem.

Could you please try cloning this repo that we created with your dependencies and vitest.config.js and see if it works for you?

We used npm install to install dependencies.

If it's working for you, can you please try adding some code similar to your project to try and make it break? Perhaps your file / folder structure is sufficiently different or you are using a different package manager?

smcenlly commented 1 year ago

Closing this issue as we haven't heard back. Will re-open the issue if we receive more information.