-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
sharding-ui-frontend add unit test #3039
Conversation
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.
@wqzwh, Good PR ! I noticed that you used karma for js unit testing . I think you should update the readme file .
@@ -9,7 +9,8 @@ | |||
"start": "npm run dev", | |||
"lint": "eslint --ext .js,.vue src", | |||
"test": "cross-env NODE_ENV=mock webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", | |||
"build": "node build/build.js" | |||
"build": "node build/build.js", | |||
"unit": "cross-env BABEL_ENV=test karma start --single-run" |
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.
@wqzwh ,now we use karma,can we remove the easy-mock?
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.
Es-mock is suitable for use in the early stages of development, but can not be used for the time being, so this iteration has been deleted.
Karma does unit testing for components and pages
</el-aside> | ||
<el-container> | ||
<el-header style="padding: 0"> | ||
<s-head @on-togger="onTogger"/> | ||
<s-head class="s-head" @on-togger="onTogger" /> |
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.
@wqzwh, maybe we need to improve the configuration of eslint to prevent useless format.
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.
add eslint rules,solve the problem of adding self-closing tags,the snippet code is as follows:
"vue/html-self-closing": ["error", {
"html": {
"void": "any",
"normal": "any",
"component": "any"
},
"svg": "any",
"math": "any"
}]
@@ -18,8 +18,8 @@ | |||
<template> | |||
<div class="s-pro-components-sider-menu-index-logo"> | |||
<a href="/"> | |||
<img class src="../../assets/img/sidebar-logo.png" alt="logo"> | |||
<img class="collapse-logo" src="../../assets/img/logo.png" alt="logo"> | |||
<img src="../../assets/img/sidebar-logo.png" alt="logo" /> |
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.
<img src="../../assets/img/sidebar-logo.png" alt="logo" /> | |
<img src="../../assets/img/sidebar-logo.png" alt="logo" > |
Here is eslint error: Disallow self-closing on HTML void elements.
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.
add eslint rules,solve the problem of adding self-closing tags,the snippet code is as follows:
"vue/html-self-closing": ["error", {
"html": {
"void": "any",
"normal": "any",
"component": "any"
},
"svg": "any",
"math": "any"
}]
1. Extending eslint rules 2. Delete easymock-related configuration 3. Modify node version requirements in package.json 4. Update Readme
@beckhampu Details are revised as follows:
|
@wqzwh , build failure. You change the node version in file package.json, so you need to change it for frontend-maven-plugin. |
ok |
@terrymanu ,it's alright now. This pr can be merged. |
Fixes #3038 .
sharding-ui-frontend add unit test
add packages:
# unit test npm run unit