This chapter describes the test-related configuration
You need to enable the unit testing feature with pnpm run new
first.
object | Function
{}
The configuration corresponding to Jest, when of type object
, can be configured with all the underlying configurations supported by Jest .
When the value is of type Function
, the default configuration is passed as the first parameter and a new Jest configuration object needs to be returned.
'babel-jest' | 'ts-jest'
'babel-jest'
Configure the compilation tool for the source code when executing tests: babel-jest or ts-jest. The default is babel-jest
.
babel-jest
can also compile TS files without type errors, so use ts-jest
if you need to check the TS type when running tests.