Skip to content

Commit

Permalink
feat: testing-library
Browse files Browse the repository at this point in the history
  • Loading branch information
logustra committed Jul 23, 2021
1 parent e518368 commit 601eab3
Show file tree
Hide file tree
Showing 8 changed files with 3,241 additions and 116 deletions.
1 change: 1 addition & 0 deletions .jest/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
33 changes: 33 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
verbose: true,
collectCoverage: true,
coverageReporters: ['lcov', 'text', 'text-summary'],
transformIgnorePatterns: ['<rootDir>/node_modules'],
setupFilesAfterEnv: ['<rootDir>/.jest/setup.ts'],
snapshotSerializers: ['jest-serializer-vue'],
moduleFileExtensions: [
'vue',
'js',
'ts'
],

transform: {
'.*\\.vue$': 'vue-jest',
'.*\\.ts$': 'ts-jest',
'.+\\.(css|scss|svg|png|jpg|jpeg|ttf|woff|woff2)$': 'jest-transform-stub'
},

moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@@/(.*)$': '<rootDir>/src/modules/$1',
'^atoms': '<rootDir>/src/components/atoms',
'^molecules': '<rootDir>/src/components/molecules',
'^organisms': '<rootDir>/src/components/organisms',
'^templates': '<rootDir>/src/components/templates'
},

watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
]
}
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"scripts": {
"prepare": "husky install",
"clean:dist": "rimraf dist",
"clean:coverage": "rimraf coverage",
"dev": "cp env/env.dev .env && vite --mode development",
"build:dev": "pnpm clean:dist && cp env/env.dev .env && vite build --mode production",
"build:prod": "pnpm clean:dist && cp env/env.prod .env && vite build --mode production",
Expand All @@ -35,7 +36,9 @@
"linter": "eslint -c .eslintrc.js --ext .js,.vue,.ts, src",
"linter:fix": "eslint -c .eslintrc.js --fix --ext .js,.vue,.ts, src",
"lint": "pnpm linter && pnpm stylelint",
"lint:fix": "pnpm linter:fix && pnpm stylelint:fix"
"lint:fix": "pnpm linter:fix && pnpm stylelint:fix",
"test": "pnpm clean:coverage && jest",
"test:watch": "pnpm clean:coverage && jest --watch"
},
"config": {
"commitizen": {
Expand All @@ -45,6 +48,9 @@
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/vue": "^6.4.2",
"@types/jest": "^26.0.24",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.23.0",
"@vitejs/plugin-legacy": "^1.3.4",
Expand All @@ -57,13 +63,19 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-vue": "^7.9.0",
"jest": "26.6.3",
"jest-serializer-vue": "^2.0.2",
"jest-transform-stub": "^2.0.0",
"jest-watch-typeahead": "^0.6.4",
"shelljs": "^0.8.4",
"standard": "^16.0.3",
"stylelint": "^13.13.1",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-config-standard": "^21.0.0",
"stylelint-rscss": "^0.4.0",
"stylelint-scss": "^3.19.0"
"stylelint-scss": "^3.19.0",
"ts-jest": "26.5.6",
"vue-jest": "^5.0.0-alpha.10"
},
"dependencies": {
"@iconify/json": "^1.1.343",
Expand Down

0 comments on commit 601eab3

Please sign in to comment.