I have a project with jest and typescript. When I run jest
, the tests run correctly.
I prepared the wallaby.config.js file:
// wallaby.config.js
export default function () {
return {
autoDetect: true,
trace: true,
files: ['src/**', '!**/*Spec.ts'],
tests: ['__tests__/**/*Spec.ts'],
debug: true,
env: {
type: 'node',
runner: 'node',
},
};
}
When I try to start I get:
Failed to initialize wallaby jest.
Failed to read Jest configuration from '.': m is not defined
My packages.json as type = "module"
Also, my jest.config.js looks like:
export default {
verbose: true,
testMatch: ['<rootDir>/__tests__/**/*.ts'],
preset: 'ts-jest',
testEnvironment: 'node',
};
As I said at begin, if I type npx jest
works correctly.
I want wallaby working on my vscode.
Finally I found a workaround.
First of all install
jasmine
andesm
as dev dependency.Now update the wallay.config.js file:
Now all work. I'm running test manually with jest and wallaby is using jasmine. It doesn't seem best way but works for now.