jest.config.js 656 B

123456789101112131415161718192021222324
  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)$": "vue-jest",
  13. },
  14. setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
  15. snapshotSerializers: ["jest-serializer-vue"],
  16. collectCoverage: true,
  17. collectCoverageFrom: [
  18. "<rootDir>/components/**/*.vue",
  19. "<rootDir>/pages/*.vue",
  20. ],
  21. testURL: "http://localhost/",
  22. preset: "ts-jest/presets/js-with-babel",
  23. testEnvironment: "jsdom",
  24. }