Closed polRk closed 1 year ago
Same problem
There have been a number of changes to vitest
latest versions that have broken Wallaby's integration.
We have found and fixed some additional problems today with the latest version of vitest
.
Can you please update to Wallaby core v1.0.1369
and let us know if you're still having problems. Wallaby should update automatically for you, but if it does not, you may force a core update.
If you are still having problems, can you please provide an updated diagnostic report as it may contain different information after the latest update.
v1.0.1369
@azat-io - are you able to generate the Wallaby Diagnostics report and provide that to us?
@smcenlly Sure
{
editorVersion: '1.74.3',
pluginVersion: '1.0.348',
editorType: 'VSCode',
osVersion: 'darwin 22.2.0',
nodeVersion: 'v19.3.0',
coreVersion: '1.0.1369',
checksum: 'YjQ5OThjMzgyODY0YTE4ODExOTA3NmZlNWMwYjQyNjcsMTcwNDMyNjQwMDAwMCww',
config: {
diagnostics: {
vitest: {
file: {
config: "import { defineConfig } from 'vitest/config'\n" +
"import { mergeConfig } from 'vite'\n" +
'\n' +
"import viteConfig from './vite.config'\n" +
'\n' +
'export default mergeConfig(\n' +
' viteConfig,\n' +
' defineConfig({\n' +
' test: {\n' +
" environment: 'happy-dom',\n" +
' },\n' +
' }),\n' +
')\n'
},
config: {
allowOnly: true,
watch: true,
globals: false,
environment: 'happy-dom',
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}.config.*' ],
testTimeout: 5000,
hookTimeout: 10000,
teardownTimeout: 1000,
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: false,
reportsDirectory: './coverage',
excludeNodeModules: true,
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}.config.*',
'**/.{eslint,mocha,prettier}rc.{js,cjs,yml}'
],
reporter: [ 'text', 'html', 'clover', 'json' ],
allowExternal: false,
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}.config.*' ]
},
slowTestThreshold: 300,
defines: {},
root: '<homeDir>/Developer/wallaby-demo',
mode: [],
deps: { inline: [ {}, {}, {}, {}, {}, {}, '@nuxt/test-utils' ], registerNodeLoader: false },
snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new' },
setupFiles: [],
cache: { dir: '<homeDir>/Developer/wallaby-demo/node_modules/.vitest' },
sequence: { hooks: 'parallel' },
package: {
version: '0.26.3',
urls: { hooks: 'file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/hooks.mjs' },
paths: {
root: '<homeDir>/Developer/wallaby-demo/node_modules/.pnpm/vitest@0.26.3_happy-dom@8.1.2/node_modules/vitest',
dist: '<homeDir>/Developer/wallaby-demo/node_modules/.pnpm/vitest@0.26.3_happy-dom@8.1.2/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}.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}.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.348/wallaby07c0d1/runners/node/hooks.mjs' },
runner: '<homeDir>/.asdf/installs/nodejs/19.3.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: 'auto.detect#-2054068591'
},
packageJSON: {
dependencies: { '@vitejs/plugin-react': '^3.0.1', react: '^18.2.0', 'react-dom': '^18.2.0', vite: '^4.0.4', 'vite-plugin-html': '^3.2.0' },
devDependencies: { '@types/node': '^18.11.18', '@types/react': '^18.0.26', '@types/react-dom': '^18.0.10', '@vitest/coverage-c8': '^0.26.3', 'happy-dom': '^8.1.2', vitest: '^0.26.3' }
},
fs: { numberOfFiles: 32 },
debug: [
'2023-01-13T01:25:43.654Z config Attempting automatic configuration for angular\n',
'2023-01-13T01:25:43.656Z angular/cli config Angular CLI not found.\n',
'2023-01-13T01:25:43.656Z config Finished attempting automatic configuration for angular (2ms)\n',
'2023-01-13T01:25:43.656Z config Attempting automatic configuration for jest\n',
"2023-01-13T01:25:43.657Z jest/config Error: Module jest-cli is not found in '<homeDir>/Developer/wallaby-demo'.\n" +
' at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:25202)\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:8268)\n' +
' at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:7563)\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:7472\n' +
' at new Promise (<anonymous>)\n' +
' at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:7266)\n' +
' at Object.loadJest (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:31:22800)\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:22872\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:27605)\n' +
' at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26900)\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26809\n' +
' at new Promise (<anonymous>)\n' +
' at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26603)\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:22560)\n' +
' at Object.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26280)\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:27605)\n' +
' at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26900)\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26809\n' +
' at new Promise (<anonymous>)\n' +
' at s (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26603)\n' +
' at Object.n [as configure] (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:19:26161)\n' +
' at Config.<anonymous> (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:15:20840)\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:15:12061)\n' +
' at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:15:11356)\n' +
' at o (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/server.js:15:11105)\n',
'2023-01-13T01:25:43.657Z config Finished attempting automatic configuration for jest (1ms)\n',
'2023-01-13T01:25:43.657Z config Attempting automatic configuration for vitest\n',
'2023-01-13T01:25:43.658Z vitest/config Detected Vitest (0.26.3).\n',
'2023-01-13T01:25:44.136Z config Finished attempting automatic configuration for vitest (479ms)\n',
'2023-01-13T01:25:44.137Z project Wallaby Node version: v19.3.0\n',
'2023-01-13T01:25:44.137Z project Wallaby config: <homeDir>/Developer/wallaby-demo/auto.detect\n',
'2023-01-13T01:25:44.145Z fs File system starting\n',
'2023-01-13T01:25:44.164Z fs File system scan completed\n',
'2023-01-13T01:25:44.168Z project File cache: <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/projects/ad1de7ec3093f7a2\n',
'2023-01-13T01:25:44.197Z uiService Listening port 51235\n',
'2023-01-13T01:25:44.203Z workers Parallelism for initial run: 1, for regular run: 1\n',
'2023-01-13T01:25:44.203Z workers Starting run worker instance #0\n',
'2023-01-13T01:25:44.203Z workers Web server is listening at 52877\n',
'2023-01-13T01:25:44.204Z project Stopping process pool\n',
'2023-01-13T01:25:44.204Z project File cache is up-to-date, starting full test run\n',
'2023-01-13T01:25:44.206Z project Test run started; run priority: 3\n',
'2023-01-13T01:25:44.207Z project Running all tests\n',
'2023-01-13T01:25:44.208Z workers Starting test run, priority: 3\n',
'2023-01-13T01:25:44.208Z nodeRunner Starting sandbox [worker #0, session #os2z2]\n',
'2023-01-13T01:25:44.208Z nodeRunner Preparing sandbox [worker #0, session #os2z2]\n',
'2023-01-13T01:25:44.304Z workers Started run worker instance (delayed) #0\n',
'2023-01-13T01:25:44.304Z nodeRunner Prepared sandbox [worker #0, session #os2z2]\n',
'2023-01-13T01:25:44.304Z workers [worker #0, session #os2z2] Running tests in sandbox\n',
'2023-01-13T01:25:44.322Z workers Sandbox (active) [os2z2] error: Failed to initialize wallaby vitest.\n' +
'Could not find vitest utils\n' +
'Error: Could not find vitest utils\n' +
' at new Promise (<anonymous>)\n' +
' at new Promise (<anonymous>)\n' +
' at WebSocket.emit (node:events:513:28)\n' +
' at afterWrite (node:internal/streams/writable:500:5)\n' +
' at onwrite (node:internal/streams/writable:480:7)\n' +
' at Zlib.cb (node:internal/streams/transform:190:7)\n' +
' at Zlib.processCallback (node:zlib:613:8)\n',
'2023-01-13T01:25:44.424Z workers [os2z2] Run 0 test(s), skipped 0 test(s)\n',
'2023-01-13T01:25:44.425Z workers [os2z2] Sandbox is responsive, closing it\n',
'2023-01-13T01:25:44.426Z workers Failed to map the stack to user code, entry message: Failed to initialize wallaby vitest.\n' +
'Could not find vitest utils\n' +
'Error: Could not find vitest utils, stack: Failed to initialize wallaby vitest.\n' +
'Could not find vitest utils\n' +
'Error: Could not find vitest utils\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:4317\n' +
' at r (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:10182)\n' +
' at Object.next (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:9477)\n' +
' at <homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:9376\n' +
' at new Promise (<anonymous>)\n' +
' at __awaiter (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:9170)\n' +
' at initializeVitest (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallaby07c0d1/runners/node/vitest@0.14.0/initializer.js:14:2028)\n' +
' at <homeDir>/.vscode/exte\n',
'2023-01-13T01:25:44.426Z project Test run finished\n',
'2023-01-13T01:25:44.426Z project Processed console.log entries\n',
'2023-01-13T01:25:44.426Z project Processed loading sequences\n',
'2023-01-13T01:25:44.426Z project Processed executed tests\n',
'2023-01-13T01:25:44.427Z project Processed code coverage\n',
'2023-01-13T01:25:44.431Z project Test run result processed and sent to IDE\n'
]
}
Could you also please provide your vite.config
file?
Thanks for the sample repo. I can see you're using pnpm
. Wallaby needs to patch vite-node
, which as of vitest@0.26.x
is now a peer dependency and is not being resolved when modules are installed using pnpm
.
Please install vite-node
as a project dependency and Wallaby should work for you. Your package.json
should look like this:
package.json
{
"name": "wallaby-demo",
"private": true,
"dependencies": {
"@vitejs/plugin-react": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.4",
"vite-node": "0.26.3",
"vite-plugin-html": "^3.2.0"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"@vitest/coverage-c8": "^0.26.3",
"happy-dom": "^8.1.2",
"vitest": "^0.26.3"
}
}
@polRk - are you also using pnpm
? If so, you should be able to fix the problem the same way.
Wallaby needs to patch vite-node, which as of vitest@0.26.x is now a peer dependency and is not being resolved when modules are installed using pnpm.
Maybe Vitest team can improve something that you need there instead of patching?
@sheremet-va - there are quite a number of places that we currently patch vitest
to support our integration. This is a pretty standard approach for us based on our experience with other testing frameworks as Wallaby's design/architecture doesn't necessarily align with how testing frameworks may run from the CLI.
I expect that a fair bit of effort would be required by the vitest
team to provide an approach that addressed all of our integration points, but we're happy to work with you to see which items we can address. The up-side for us should be less breaking changes if we have formal integration points. Having said that, I expect many of our patches will need to remain to support older versions of vitest.
If you want, I am happy to create items in vitest
backlog for some of the easier items? Also happy to discuss on discord, etc. if that's a better approach.
@smcenlly feel free to ping me in Vitest Discord @async
, we can create a thread there.
@smcenlly New problem
Failed to initialize wallaby vitest.
Could not find vendor entry.
Error: Could not find vendor entry.
After updating vite-node
and vitest
to v0.28.1
I updated my test repo: https://github.com/azat-io/wallaby-demo
Here is my diagnostic report:
{
editorVersion: '1.74.3',
pluginVersion: '1.0.348',
editorType: 'VSCode',
osVersion: 'darwin 22.2.0',
nodeVersion: 'v19.4.0',
coreVersion: '1.0.1373',
checksum: 'YjQ5OThjMzgyODY0YTE4ODExOTA3NmZlNWMwYjQyNjcsMTcwNDMyNjQwMDAwMCww',
config: {
diagnostics: {
vitest: {
file: {
config: "import { defineConfig } from 'vitest/config'\n" +
"import { mergeConfig } from 'vite'\n" +
'\n' +
"import viteConfig from './vite.config'\n" +
'\n' +
'export default mergeConfig(\n' +
' viteConfig,\n' +
' defineConfig({\n' +
' test: {\n' +
" environment: 'happy-dom',\n" +
' },\n' +
' }),\n' +
')\n'
},
config: {
allowOnly: true,
watch: true,
globals: false,
environment: 'happy-dom',
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/wallaby-demo',
mode: [],
deps: { inline: [ {}, {}, {}, {}, {}, {}, '@nuxt/test-utils' ], registerNodeLoader: false },
snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new' },
setupFiles: [],
cache: { dir: '<homeDir>/Developer/wallaby-demo/node_modules/.vitest' },
sequence: { hooks: 'parallel' },
environmentMatchGlobs: [],
package: {
version: '0.28.1',
urls: { hooks: 'file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.348/wallabyb64894/runners/node/hooks.mjs' },
paths: {
root: '<homeDir>/Developer/wallaby-demo/node_modules/.pnpm/vitest@0.28.1_happy-dom@8.1.5/node_modules/vitest',
dist: '<homeDir>/Developer/wallaby-demo/node_modules/.pnpm/vitest@0.28.1_happy-dom@8.1.5/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.348/wallabyb64894/runners/node/hooks.mjs' },
runner: '<homeDir>/.asdf/installs/nodejs/19.4.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: 'auto.detect#-927380447'
},
packageJSON: {
dependencies: { '@vitejs/plugin-react': '^3.0.1', react: '^18.2.0', 'react-dom': '^18.2.0', vite: '^4.0.4', 'vite-plugin-html': '^3.2.0' },
devDependencies: {
'@types/node': '^18.11.18',
'@types/react': '^18.0.27',
'@types/react-dom': '^18.0.10',
'@vitest/coverage-c8': '^0.28.1',
'happy-dom': '^8.1.5',
'vite-node': '^0.28.1',
vitest: '^0.28.1'
}
},
fs: { numberOfFiles: 32 },
debug: []
}
After updating vite-node and vitest to v0.28.1
There have been some breaking changes in Wallaby's integration with vitest
in the latest version (released yesterday).
Please downgrade to a previous version, it should work for you. We expect to add support for the latest version by the end of this week.
In the latest version, the runner component has been extracted into its own package, so for pnpm
workspaces, you will need to install that as an explicit dependency.
Please update to the latest version of Wallaby core, 1.0.1375
and then make the following changes to your package.json
and pnpm-lock.yaml
. After making the changes, please delete your node_modules
and reinstall with pnpm install
, it should work for you.
Note: we ran into a few stability issues where tests were intermittently failing with the CLI without even using Wallaby but reinstalling node_modules
fixed the problem; if Wallaby is not working for you for some reason, please confirm that tests are running from the CLI.
package.json
{
"name": "wallaby-demo",
"private": true,
"dependencies": {
"@vitejs/plugin-react": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.4",
"vite-plugin-html": "^3.2.0"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitest/coverage-c8": "^0.28.1",
+ "@vitest/runner": "^0.28.1",
"happy-dom": "^8.1.5",
"vite-node": "^0.28.1",
"vitest": "^0.28.1"
}
}
pnpm-lock.yaml
lockfileVersion: 5.4
specifiers:
'@types/node': ^18.11.18
'@types/react': ^18.0.27
'@types/react-dom': ^18.0.10
'@vitejs/plugin-react': ^3.0.1
'@vitest/coverage-c8': ^0.28.1
+ '@vitest/runner': ^0.28.1
happy-dom: ^8.1.5
react: ^18.2.0
react-dom: ^18.2.0
vite: ^4.0.4
vite-node: ^0.28.1
vite-plugin-html: ^3.2.0
vitest: ^0.28.1
dependencies:
'@vitejs/plugin-react': 3.0.1_vite@4.0.4
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
vite: 4.0.4_@types+node@18.11.18
vite-plugin-html: 3.2.0_vite@4.0.4
devDependencies:
'@types/node': 18.11.18
'@types/react': 18.0.27
'@types/react-dom': 18.0.10
'@vitest/coverage-c8': 0.28.1_happy-dom@8.1.5
+ '@vitest/runner': 0.28.1
happy-dom: 8.1.5
vite-node: 0.28.1_@types+node@18.11.18
vitest: 0.28.1_happy-dom@8.1.5
packages:
...
We've updated Wallaby's pnpm
integration so that you no longer need to explicitly installed @vitest/runner
or vite-node
when using vite.
Still having that problem ....
Using wallaby 1.0.259
Vitest 0.28.5
pnpm 7.27.0
node 16.13.0
Is there a workarround that needs to be done ?
@TeaBough - there's no workaround that needs to be applied. It sounds like your problem may be different to the root cause of this resolved issue.
Could you please create a new issue and provide your diagnostics report?
Just as a heads up, I'm running into the same problem, and adding @vitest/runner
fixes it, so this might have been reintroduced at some point.
@lucastraba - it sounds like you must be using pnpm
, if so, it's expected that you will need to install @vitest/runner
. If you're not using pnpm
, could you please let us know what package manager you are using? By default, you don't need to install @vitest/runner
.
@smcenlly Sorry, I just saw this! Yes, true, I'm using pnpm
. Sorry for the confusion!
Just a quick question regarding this. Is there a way this can be done without modifying the package.json
? My team is not very happy that I introduced these dependencies because only one of them uses Wallaby and they seem unnecessary to them.
By "these dependencies", I mean @vitest/runner
and @vitest/snapshot
, which Wallaby also requires now, and with which it does work.
@lucastraba It should be possible, assuming vitest's hoist patterns work for your project. Please see https://github.com/wallabyjs/public/issues/3258#issuecomment-1674082258 for details. Please let us know if that doesn't work for you.
This worked indeed! Thanks!
Issue description or question
0 failing tests, 0 passing Launch Coverage & Test Explorer | Search Tests
Failed to initialize wallaby vitest. Could not find vitest utils Error: Could not find vitest utils
Wallaby diagnostics report