我正在尝试将 ci/cd 工作流与 github Actions 一起使用,
我使用 jest 进行单元测试并设置moduleNameMapper
如下:
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/src/$1",
"^components/(.*)$": "<rootDir>/src/components/$1"
}
我可以npm test
在本地成功运行,但是 github 操作总是出错:
Could not locate module src/components/tool-panel/Container.vue (mapped as /home/runner/work/its-me/its-me/src/components/tool-panel/Container.vue)
Please check:
"moduleNameMapper": {
"/^src\/(.*)$/": "/home/runner/work/its-me/its-me/src/$1"
},
"resolver": undefined
似乎<rootDir>
被替换为,并且此路径 /home/runner/work/its-me/its-me
中没有文件夹: 。src
/home/runner/work/its-me/its-me
那么如何设置正确的根路径?
我不确定我是否可以 ssh 到 github 操作服务器。
这是我的 github 仓库:是我
任何帮助,将不胜感激!!