Skip to content
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

style(test): add eslint configuration for unit tests #2518

Merged
merged 3 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,18 @@
"extends": [
"plugin:vue-libs/recommended",
"plugin:flowtype/recommended"
],
"overrides": [
{
"files": [
"**/*.spec.js"
],
"plugins": [
"jasmine"
],
"env": {
rchl marked this conversation as resolved.
Show resolved Hide resolved
"jasmine": true
}
}
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dev": "node examples/server.js",
"dev:dist": "rollup -wm -c build/rollup.dev.config.js",
"build": "node build/build.js",
"lint": "eslint src examples",
"lint": "eslint src examples test/unit",
"test": "npm run lint && npm run flow && npm run test:unit && npm run test:e2e && npm run test:types",
"flow": "flow check",
"test:unit": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
Expand Down Expand Up @@ -64,6 +64,7 @@
"es6-promise": "^4.2.4",
"eslint": "^4.19.1",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-jasmine": "^2.10.1",
"eslint-plugin-vue-libs": "^2.1.0",
"express": "^4.16.2",
"express-urlrewrite": "^1.2.0",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Usage in Node', () => {
{ path: '/', component: Foo },
{ path: '/bar', component: Bar, children: [
{ path: 'baz', component: Baz }
]}
] }
]
})
expect(router.getMatchedComponents('/')).toEqual([Foo])
Expand Down
4 changes: 2 additions & 2 deletions test/unit/specs/route.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ describe('Route utils', () => {
}
const b = {
path: '/abc',
query: { arr: [1, 2], foo: { bar: 'bar' } }
query: { arr: [1, 2], foo: { bar: 'bar' }}
}
const c = {
path: '/abc',
query: { arr: [1, 2], foo: { bar: 'not bar' } }
query: { arr: [1, 2], foo: { bar: 'not bar' }}
}
expect(isSameRoute(a, b)).toBe(true)
expect(isSameRoute(a, c)).toBe(false)
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,11 @@ eslint-plugin-html@^4.0.1:
dependencies:
htmlparser2 "^3.8.2"

eslint-plugin-jasmine@^2.10.1:
version "2.10.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jasmine/-/eslint-plugin-jasmine-2.10.1.tgz#5733b709e751f4bc40e31e1c16989bd2cdfbec97"
integrity sha1-VzO3CedR9LxA4x4cFpib0s377Jc=

eslint-plugin-vue-libs@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-vue-libs/-/eslint-plugin-vue-libs-2.1.0.tgz#e7faf4ae11dad58553f63f907d6642e2d816dcef"
Expand Down