Last active
January 18, 2020 23:09
-
-
Save brandonaaskov/9349a9693b9e405b5a903667d4cf6e0b to your computer and use it in GitHub Desktop.
Jest config file that adds one-time setup file before test suites start running
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
globalSetup: "<rootDir>/jest.setup.js", // this line is the only change here | |
moduleNameMapper: { | |
"^@/(.*)$": "<rootDir>/$1", | |
"^~/(.*)$": "<rootDir>/$1", | |
"^vue$": "vue/dist/vue.common.js" | |
}, | |
moduleFileExtensions: ["js", "vue", "json"], | |
testEnvironment: "jsdom", | |
transform: { | |
"^.+\\.js$": "babel-jest", | |
".*\\.(vue)$": "vue-jest" | |
}, | |
collectCoverage: true, | |
collectCoverageFrom: ["<rootDir>/**/*.(vue|js)"], | |
forceExit: !!process.env.CI // almost every CI platform sets this by default | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment