jest.config.js 696 B

123456789101112131415161718192021222324252627
  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. globals: {
  15. "vue-jest": {
  16. templateCompiler: {
  17. compiler: require("vue-template-babel-compiler"),
  18. },
  19. },
  20. },
  21. setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
  22. snapshotSerializers: ["jest-serializer-vue"],
  23. collectCoverage: true,
  24. testURL: "http://localhost/",
  25. preset: "ts-jest/presets/js-with-babel",
  26. testEnvironment: "jsdom",
  27. }