I’m building an app with vuejs and testing with jest and running the tests locally works, but on circleci fails with the error
FAIL test/unit/specs/components/ui/MessageUI.spec.js
Test suite failed to run
Configuration error:
Could not locate module @/components/ui/MessageUi (mapped as /home/circleci/repo/src/components/ui/MessageUi)
Please check:
"moduleNameMapper": {
"/^@\/(.*)$/": "/home/circleci/repo/src/$1"
},
"resolver": undefined
is not finding the component with the alias @.
the failing component require:
import Component from '@/components/ui/MessageUi'
in the same folder I have another test, working, with:
In my case I think is related to the building SO and the file names case.
On MAC I can include a file named MyModule.vue even if the file name is myModule.vue, but on UNIX is not possible to find this file.
Another trick is that is not possible just rename the file from myModule.vue to MyModule.vue, because github will just ignore the change. Locally I see the right name, but on the repository the name still wrong, so to really change the name on github I was forced to rename to something completelly different (___MyModule.vue), commit and push, and after thjis aplly the proper name (MyModule.vue)
after this, my builds on unix system worked, Im using DroneCI now.