Open mrtnmgs opened 1 month ago
Hey @mrtnmgs thanks for reporting this, I was just able to confirm that the files in the __mocks__
directory are being copied over. This isn't specific behavior to that directory though - any code in src/
will be copied to the dist output target by Stencil actually. So I think in order to change this behavior we'd need to add an ignore
option or something.
I'm going to label this a feature request so we can gauge community interest in such a feature!
Thanks @alicewriteswrongs. That feature sounds nice, but right now things don't work properly by default. There's no reason to copy __mocks__
directories over, and it creates an issue. It doesn't sound right to me to ask the user to configure something in order to fix it... Shouldn't __mocks__
directories be ignored by default?
Closing as this is part of a larger issue, see https://github.com/ionic-team/stencil/issues/5788
Prerequisites
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:I wondered if I wasn't supposed to write the mocks in TypeScript, but same thing with .js files:
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 directoriesSystem Info
Steps to Reproduce
create file
src/global/functions.tsx
and matching mocksrc/global/__mocks__/functions.tsx
. runnpm test
.Code Reproduction URL
https://github.com/mrtnmgs/mockbug
Additional Information
No response