Typescript
If your editor or TypeScript compiler does not recognise the custom jest-extended matchers, you can add jest-extended to compilerOptions.types in your tsconfig.json:
{
"compilerOptions": {
"types": ["jest", "jest-extended"]
}
}
Alternatively, add a global.d.ts file to your project with:
import 'jest-extended';
When using ts-jest >= 25.5.0
Since the breaking changes in 25.5.0 you may also need to update your tsconfig.json to include the new global.d.ts file in the files property like so:
{
"compilerOptions": {
...
},
...
"files": ["global.d.ts"]
}
Also note that when adding this for the first time this affects which files are compiled by the TypeScript compiler and you might need to add the include property as well. See the TypeScript docs for more details.
If the above import syntax does not work, replace it with the following:
/// <reference types="jest-extended" />
An example of project with Typescript globally setup can be found here.