Skip to content

Commit

Permalink
test: Add jest and vue-test-utils setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-santosP committed Apr 16, 2021
1 parent fd2d618 commit a1a4770
Show file tree
Hide file tree
Showing 4 changed files with 3,505 additions and 25 deletions.
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
coverageDirectory: "coverage",
testMatch: ["**/__tests__/**/*.spec.ts", "**/__tests__/**/*.test.ts"],
moduleFileExtensions: ["js", "ts", "json", "vue"],
transform: {
"^.+\\.ts$": "ts-jest",
"^.+\\.vue$": "vue-jest",
},
};
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",
"serve": "vite preview",
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
"deploy": "push-dir --dir=dist --branch=gh-pages --cleanup",
"test": "jest --watch --passWithNoTests --onlyChanged"
},
"dependencies": {
"vue": "^3.0.5"
},
"devDependencies": {
"@types/jest": "^26.0.22",
"@vitejs/plugin-vue": "^1.2.1",
"@vue/compiler-sfc": "^3.0.5",
"@vue/test-utils": "^2.0.0-rc.4",
"autoprefixer": "^10.2.5",
"jest": "^26.6.3",
"postcss": "^8.2.10",
"push-dir": "^0.4.1",
"tailwindcss": "^2.1.1",
"ts-jest": "^26.5.5",
"typescript": "^4.1.3",
"vite": "^2.1.5",
"vue-jest": "^5.0.0-alpha.7",
"vue-tsc": "^0.0.15"
}
}
10 changes: 8 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["vite/client"]
"types": ["vite/client", "@types/jest"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.vue",
"__tests__/**/*.vue",
"__tests__/**/*.ts"
]
}
Loading

0 comments on commit a1a4770

Please sign in to comment.