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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "ES2017", | |
"lib": ["es6", "dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"strict": false, | |
"forceConsistentCasingInFileNames": true, | |
"noEmit": true, | |
"esModuleInterop": true, |
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
import { shallowMount } from "@vue/test-utils"; | |
import Logo from "../Logo"; | |
const factory = () => { | |
return shallowMount(Logo, { | |
}); | |
}; | |
describe("Logo", () => { |
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
{ | |
"name": "nuxt-jest", | |
"version": "1.0.0", | |
"description": "Nuxt jest sample config", | |
"author": "Alex Gogl", | |
"private": true, | |
"scripts": { | |
"dev": "nuxt", | |
"build": "nuxt build", | |
"start": "nuxt start", |
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
function isBabelLoader(caller) { | |
return caller && caller.name === "babel-loader"; | |
} | |
module.exports = function(api) { | |
if (api.env("test") && !api.caller(isBabelLoader)) { | |
return { | |
presets: [ | |
[ | |
"@babel/preset-env", |
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 = { | |
// tell Jest to handle `*.vue` files | |
moduleFileExtensions: ["js", "json", "vue"], | |
watchman: false, | |
moduleNameMapper: { | |
"^~/(.*)$": "<rootDir>/$1", | |
"^~~/(.*)$": "<rootDir>/$1", | |
"^@/(.*)$": "<rootDir>/$1" | |
}, | |
transform: { |
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
{ | |
"root": true, | |
"env": { | |
"node": true, | |
"jest": true | |
}, | |
"extends": [ | |
"plugin:vue/recommended", | |
"eslint:recommended", | |
"prettier/vue", |
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
"rules": { | |
"prettier/prettier": [ | |
"error", | |
{ | |
"singleQuote": false, | |
"tabWidth": 4 | |
} | |
] | |
}, |
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 = { | |
root: true, | |
env: { | |
node: true, | |
browser: true | |
}, | |
extends: [ | |
"plugin:vue/recommended", | |
"eslint:recommended", | |
"prettier/vue", |
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
"eslintConfig": { | |
"root": true, | |
"env": { | |
"node": true | |
}, | |
"extends": [ | |
"plugin:vue/recommended", | |
"eslint:recommended", | |
"plugin:prettier/recommended", | |
"prettier/vue" |
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
{ | |
"editor.formatOnSave": true, | |
"vetur.validation.template": false, | |
"editor.codeActionsOnSave": { | |
"source.fixAll.eslint": true | |
} | |
} |