0

github アクションで ci/cd ワークフローを使用しようとしていますが、

私は単体テストに 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

では、正しいルートパスを設定するにはどうすればよいですか?

githubアクションサーバーにsshできるかどうかわかりません。

これは私の github リポジトリです: It's me

どんな助けでも大歓迎です!!

4

1 に答える 1