jest-canvas-mock icon indicating copy to clipboard operation
jest-canvas-mock copied to clipboard

Multiple configurations found when configure jest-canvas-mock

Open Choupa-web opened this issue 2 years ago • 1 comments

Hello,

I work on an angular app and I need to test canvas element.

So I installed jest-canvas-mock, added the :
"jest": { "setupFiles": ["jest-canvas-mock"] },

in package.json.

when I run the tests I have the following message: Multiple configurations found: * /home/sraye/IdeaProjects/customer/evercampaign/jest.config.ts * jest key in /home/sraye/IdeaProjects/customer/evercampaign/package.json

In fact my jest setup is in the file jest.config.ts:

const { getJestProjects } = require('@nrwl/jest'); export default { projects: getJestProjects() };

any idea on how I can resolve this ? Thanks

Choupa-web avatar Jul 04 '22 09:07 Choupa-web

If you already have a jest.config.js (or .ts) file, you can put jest-canvas-mock in the customJestConfig.setupFiles array. It works for me.

Reference: Official Jest configuration - setupFiles

leoh7 avatar Sep 19 '23 07:09 leoh7