Skip to content

Commit

Permalink
单测增加cases测试
Browse files Browse the repository at this point in the history
  • Loading branch information
wupengFEX committed Jan 12, 2018
1 parent ffd6c85 commit b603fa2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
8 changes: 0 additions & 8 deletions cases/215.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
"offset": 514,
"input": " <link rel=\"miphtml\" href=\"//www.baidu.com\"> "
},
{
"message": "标签'<link rel=\"/^(miphtml)$/\">'只能出现一次",
"code": "06200701",
"line": 12,
"col": 5,
"offset": 563,
"input": " <link rel=\"miphtml\" href=\"//www.baidu.com\"> "
},
{
"message": "标签'<link rel=\"/^(miphtml)|(canonical)$/\">'只能出现一次",
"code": "06200701",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"node": ">=4.0.0"
},
"scripts": {
"test": "DEBUG='mip-validator:' mocha",
"test": "DEBUG='mip-validator:' mocha && npm run test:e2e",
"test:e2e": "make cases",
"lint": "eslint src/ test/ bin/ index.js",
"preversion": "npm run lint && npm test",
"version": "make dist && git add -A dist",
Expand Down
6 changes: 2 additions & 4 deletions rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@
}],
"mandatory_parent": "head",
"duplicate": [{
"rel": "/^(miphtml)$/"
}, {
"rel": "/^(miphtml)|(canonical)$/"
}],
"attrs": {
"href": [{
"value": "/^(http(s)?:)?\/\//",
"match": {
"rel": "/^(canonical)|(miphtml)$/"
"rel": "/^((canonical)|(miphtml))$/"
}
}, {
"value": "/^(?!\/[^\/])/",
"match": {
"rel": "/^(?!((canonical)|(miphtml))$)/"
"rel": "/^(?!((miphtml)|(canonical))$)/"
}
}]

Expand Down

0 comments on commit b603fa2

Please sign in to comment.