Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Add Jest testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thislooksfun committed Sep 11, 2019
1 parent 58afd0f commit c0e82ba
Show file tree
Hide file tree
Showing 9 changed files with 2,609 additions and 330 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ module.exports = {
overrides: [
{
files: ["**/__tests__/*.{j,t}s?(x)"],
env: {
mocha: true,
},
env: { jest: true },
},
],
};
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ yarn-error.log*
*.sln
*.sw?

#Electron-builder output
/dist_electron
# Electron-builder output
/dist_electron

# Coverage
/coverage
27 changes: 27 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
collectCoverageFrom: ["src/**/*.(js|vue)"],
coverageDirectory: "./coverage",
coverageReporters: ["lcov", "text-summary"],
moduleFileExtensions: ["js", "jsx", "json", "vue"],
transform: {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub",
"^.+\\.jsx?$": "babel-jest",
},
transformIgnorePatterns: ["/node_modules/"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
// Named 'setupFilesAfterEnv' in Jest 24+
setupTestFrameworkScriptFile: "./tests/setup/expect.js",
snapshotSerializers: ["jest-serializer-vue"],
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)",
],
testURL: "http://localhost/",
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
};
Loading

0 comments on commit c0e82ba

Please sign in to comment.