#ts-jest getting confused with my built files

2 messages · Page 1 of 1 (latest)

brisk path
#

Hey, whenever I run my jest tests it outputs following error:

 packages/core/src/contexts/IControllerContext.ts:5:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'moduleController' must be of type 'ModuleController', but here has type 'ModuleController'.

    5         moduleController: ModuleController
              ~~~~~~~~~~~~~~~~

      packages/core/dist/types/contexts/IControllerContext.d.ts:4:9
        4         moduleController: ModuleController;
                  ~~~~~~~~~~~~~~~~
        'moduleController' was also declared here.

The files in dist should be fully ignored as they are just package build files and I tried every setting for my jest.config.js to get it to ignore them.

If I delete them everything runs fine but I would like to keep those and not need to delete them and rebuild everytime i want to execute the tests
Would be grateful for any solution

brisk path
#

Finally found something:

    transform: {
        "^.+\\.ts?$": [
            "ts-jest",
            {
                diagnostics: false
            }
        ]
    },