Open mariovor opened 1 year ago
Not sure what's happening in your case, but stub.css
is copied over to the dist
folder when running build
script, so the current mapping is already correct and AFAIK it works on a newly generated project
Have you tried reinstalling your dependencies?
Could you check node_modules/@quasar/quasar-app-extensions-testing-unit-jest/dist
and let me know if you see stub.css
inside it?
I see stub.css
in the dist folder. No idea why I get this error.
Can you reproduce this into a clean project?
I created a new project, added a css file and import it in the MyButton.vue demo file
FAIL test/jest/__tests__/MyButton.spec.js
● Test suite failed to run
Configuration error:
Could not locate module ./css/table_styles.css mapped as:
@quasar/quasar-app-extension-testing-unit-jest/stub.css.
Please check your configuration for these entries:
{
"moduleNameMapper": {
"/.*css$/": "@quasar/quasar-app-extension-testing-unit-jest/stub.css"
},
"resolver": undefined
}
1 | <script>
2 | import { defineComponent, ref } from 'vue';
> 3 | import './css/table_styles.css'
| ^
4 |
5 | export default defineComponent({
6 | name: 'MyButton',
at createNoMappedModuleFoundError (node_modules/jest-resolve/build/resolver.js:752:17)
at Object.<anonymous> (test/jest/__tests__/demo/MyButton.vue:3:1)
at Object.<anonymous> (test/jest/__tests__/MyButton.spec.js:5:1)
What kind of change does this PR introduce? (check at least one)
If you are adding a new test runner, have you...? (check all)
/packages/base/runners.json
?/README.md
?baseline.spec.vue
?Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch and not themaster
branchfix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: I encountered an error
which is fixed on my site with the change of path to the stub.css.