-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Karma + Mocha with Jest #824
Changes from 34 commits
a529975
de30cab
3af6a44
abbd2c5
6263bce
636e3b2
56427e7
e7ec3b1
48f89ec
0744aa1
f6541fc
de0ce71
f52e256
21bfde6
84ab9d0
823e3c3
d117247
415caed
cd78d3a
d8ffc52
2eaf47d
fd9c3ef
0418571
8bc554c
be3efc0
a355ee8
6043118
cfe2cc2
27f79e8
6710dad
055a3a0
d8fd92a
dd21933
de8ed39
78fd900
d16a553
e396d70
0867775
3625080
6f5d88d
a35c931
e817d3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
'use strict' | ||
// Template version: 1.1.3 | ||
// see http://vuejs-templates.github.io/webpack for documentation. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,23 @@ | |
"author": "{{ author }}", | ||
"private": true, | ||
"scripts": { | ||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", | ||
"dev": "node build/dev-server.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, that merge doesn't look like it's supposed to I think ... the webpack-dev-server is new in the Similarly, the other additions to package.json down in this file are all "bringing back" dependencies of the old dev-server. But we might simply resolve this during / after the merge .. |
||
"start": "npm run dev", | ||
"build": "node build/build.js"{{#unit}}, | ||
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run"{{/unit}}{{#e2e}}, | ||
"e2e": "node test/e2e/runner.js"{{/e2e}}{{#if_or unit e2e}}, | ||
"test": "{{#unit}}npm run unit{{/unit}}{{#unit}}{{#e2e}} && {{/e2e}}{{/unit}}{{#e2e}}npm run e2e{{/e2e}}"{{/if_or}}{{#lint}}, | ||
"lint": "eslint --ext .js,.vue src{{#unit}} test/unit/specs{{/unit}}{{#e2e}} test/e2e/specs{{/e2e}}"{{/lint}} | ||
{{#if_eq runner "jest"}} | ||
"unit": "jest test/unit/specs --coverage", | ||
{{/if_eq}} | ||
{{#if_eq runner "karma"}} | ||
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", | ||
{{/if_eq}} | ||
{{#e2e}} | ||
"e2e": "node test/e2e/runner.js",{{/e2e}} | ||
{{#if_or unit e2e}} | ||
"test": "{{#unit}}npm run unit{{/unit}}{{#unit}}{{#e2e}} && {{/e2e}}{{/unit}}{{#e2e}}npm run e2e{{/e2e}}", | ||
{{/if_or}} | ||
{{#lint}} | ||
"lint": "eslint --ext .js,.vue src{{#unit}} test/unit/specs{{/unit}}{{#e2e}} test/e2e/specs{{/e2e}}", | ||
{{/lint}} | ||
"build": "node build/build.js" | ||
}, | ||
"dependencies": { | ||
"vue": "^2.5.2"{{#router}}, | ||
|
@@ -29,6 +39,7 @@ | |
"babel-preset-stage-2": "^6.22.0", | ||
"babel-register": "^6.22.0", | ||
"chalk": "^2.0.1", | ||
"connect-history-api-fallback": "^1.3.0", | ||
"copy-webpack-plugin": "^4.0.1", | ||
"css-loader": "^0.28.0", | ||
{{#lint}} | ||
|
@@ -50,12 +61,19 @@ | |
{{/if_eq}} | ||
{{/lint}} | ||
"eventsource-polyfill": "^0.9.6", | ||
"express": "^4.14.1", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"file-loader": "^1.1.4", | ||
"friendly-errors-webpack-plugin": "^1.6.1", | ||
"html-webpack-plugin": "^2.30.1", | ||
"http-proxy-middleware": "^0.17.3", | ||
"webpack-bundle-analyzer": "^2.9.0", | ||
{{#unit}} | ||
{{#if_eq runner "jest"}} | ||
"babel-jest": "^21.0.2", | ||
"jest": "^21.2.0", | ||
"vue-jest": "^1.0.1", | ||
{{/if_eq}} | ||
{{#if_eq runner "karma"}} | ||
"cross-env": "^5.0.1", | ||
"karma": "^1.4.1", | ||
"karma-coverage": "^1.1.1", | ||
|
@@ -73,8 +91,7 @@ | |
"inject-loader": "^3.0.0", | ||
"babel-plugin-istanbul": "^4.1.1", | ||
"phantomjs-prebuilt": "^2.1.14", | ||
{{/unit}} | ||
"node-notifier": "^5.1.2", | ||
{{/if_eq}} | ||
{{#e2e}} | ||
"chromedriver": "^2.27.2", | ||
"cross-spawn": "^5.0.1", | ||
|
@@ -83,19 +100,46 @@ | |
{{/e2e}} | ||
"semver": "^5.3.0", | ||
"shelljs": "^0.7.6", | ||
"opn": "^5.1.0", | ||
"optimize-css-assets-webpack-plugin": "^3.2.0", | ||
"ora": "^1.2.0", | ||
"postcss-loader": "^2.0.8", | ||
"rimraf": "^2.6.0", | ||
"url-loader": "^0.5.8", | ||
"vue-loader": "^13.3.0", | ||
"vue-style-loader": "^3.0.1", | ||
"vue-template-compiler": "^2.5.2", | ||
"portfinder": "^1.0.13", | ||
"webpack": "^3.6.0", | ||
"webpack-dev-server": "^2.9.1", | ||
"webpack-dev-middleware": "^1.12.0", | ||
"webpack-hot-middleware": "^2.18.2", | ||
"webpack-merge": "^4.1.0" | ||
}, | ||
{{#unit}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't that be |
||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"vue" | ||
], | ||
"moduleNameMapper": { | ||
"^@/(.*)$": "<rootDir>/src/$1" | ||
}, | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" | ||
}, | ||
"setupFiles": ["<rootDir>/test/unit/setup"], | ||
"mapCoverage": true, | ||
"collectCoverageFrom" : [ | ||
"src/**/*.{js,vue}", | ||
"!src/main.js", | ||
{{#router}} | ||
"!src/router/index.js", | ||
{{/router}} | ||
"!**/node_modules/**" | ||
] | ||
}, | ||
{{/unit}} | ||
"engines": { | ||
"node": ">= 4.0.0", | ||
"npm": ">= 3.0.0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,11 @@ export default new Router({ | |
routes: [ | ||
{ | ||
path: '/', | ||
<<<<<<< HEAD | ||
name: 'HelloWorld', | ||
======= | ||
name: 'Hello', | ||
>>>>>>> 89c6fb18d4640afd6a5e89106b2493b4465d36a3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You seem to have some leftovers from an older merge conflict... |
||
component: HelloWorld{{#if_eq lintConfig "airbnb"}},{{/if_eq}} | ||
}{{#if_eq lintConfig "airbnb"}},{{/if_eq}} | ||
]{{#if_eq lintConfig "airbnb"}},{{/if_eq}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since we are leaving the karma/mocha setup in place, the eslint config should probably also leave this in. It should be conditional: {
"env": {{{#if_eq runner "karma"}}
"mocha": true{{/if_eq}}{{#if_eq runner "jest"}}
"jest"{{/if_eq}}
}{{#if_eq runner "karma"}},
"globals": {
"expect": true,
"sinon": true,
"jest": true
}{{/if_eq}}
} |
||
}, | ||
"globals": { | ||
"expect": true, | ||
"sinon": true | ||
"jest": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Vue from 'vue' | ||
|
||
Vue.config.productionTip = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddyerburgh Since we are leaving the karma setup available, I don't think we should remove this docs section.
We should rather leave that docs in, but prepend the page with new infos about jest.