jest.config.js 601 B

1234567891011121314151617181920
  1. module.exports = {
  2. moduleFileExtensions: ["ts", "js", "json", "vue"],
  3. watchman: false,
  4. moduleNameMapper: {
  5. "^@/(.*)$": "<rootDir>/$1",
  6. "^~/(.*)$": "<rootDir>/$1",
  7. "^vue$": "vue/dist/vue.common.js",
  8. },
  9. transform: {
  10. "^.+\\.ts$": "ts-jest",
  11. "^.+\\.js$": "babel-jest",
  12. ".*\\.(vue)$": require.resolve("./jest-script-setup-transform.js"),
  13. },
  14. setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
  15. snapshotSerializers: ["jest-serializer-vue"],
  16. collectCoverage: true,
  17. testURL: "http://localhost/",
  18. preset: "ts-jest/presets/js-with-babel",
  19. testEnvironment: "jsdom",
  20. }