-
-
Notifications
You must be signed in to change notification settings - Fork 835
bug: __mocks__ copied to output target #5781
Copy link
Copy link
Closed
AnirudhJalagam/ionic-frameworkss
#2Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.18.0
Current Behavior
Stencil copies over mocks directories to dist and throws warnings about duplicate mocks.
The mocks are ./src/global/services/__mocks__ and ./src/global/__mocks__
Stencil's console warning:
jest-haste-map: duplicate manual mock found: functions
The following files share their name; please delete one of them:
* <rootDir>\src\global\__mocks__\functions.tsx
* <rootDir>\dist\collection\global\__mocks__\functions.js
*
jest-haste-map: duplicate manual mock found: http-service
The following files share their name; please delete one of them:
* <rootDir>\src\global\services\__mocks__\http-service.tsx
* <rootDir>\dist\collection\global\services\__mocks__\http-service.js
I wondered if I wasn't supposed to write the mocks in TypeScript, but same thing with .js files:
jest-haste-map: duplicate manual mock found: functions
The following files share their name; please delete one of them:
* <rootDir>\src\global\__mocks__\functions.js
* <rootDir>\dist\collection\global\__mocks__\functions.js
jest-haste-map: duplicate manual mock found: http-service
The following files share their name; please delete one of them:
* <rootDir>\src\global\services\__mocks__\http-service.js
* <rootDir>\dist\collection\global\services\__mocks__\http-service.js
I couldn't find a config option that would allow to explicitly exclude these directories.
Expected Behavior
__mocks__ directories should be excluded when copying files to build directories
System Info
Windows, npm 9.7.2Steps to Reproduce
create file src/global/functions.tsx and matching mock src/global/__mocks__/functions.tsx. run npm test.
Code Reproduction URL
https://github.com/mrtnmgs/mockbug
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Feature: Want this? Upvote it!This PR or Issue may be a great consideration for a future idea.This PR or Issue may be a great consideration for a future idea.