Skip to content

Commit b13e455

Browse files
bz2bahmutov
authored andcommitted
Use eslint plugin to catch exclusive tests (cypress-io#2194)
On platforms without a decent grep, it seems stop-only does a poor job of correctly detecting focused tests. There's an eslint plugin which is much more suitable, use that instead. While changing eslint config, tidy up the lint commands and fix a couple of minor issues in files that were not being linted. Exclude public/ and themes/ folders from lint, cover everything else.
1 parent dc15990 commit b13e455

File tree

8 files changed

+3546
-3582
lines changed

8 files changed

+3546
-3582
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/public/*
2+
/themes/*

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"plugins": [
3-
"cypress"
3+
"cypress",
4+
"no-only-tests"
45
],
56
"extends": [
67
"plugin:cypress-dev/general",
@@ -10,5 +11,8 @@
1011
"es6": true,
1112
"node": true,
1213
"cypress/globals": true
14+
},
15+
"rules": {
16+
"no-only-tests/no-only-tests": "warn"
1317
}
1418
}

circle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ jobs:
6666
#
6767
- run: ls -la
6868
- run: npm run deps
69-
- run: npm run lint
69+
- run: npm run lint -- --max-warnings=0
7070
- run: npm run md-lint
71-
- run: npm run stop-only
7271
- run: npm test
7372
- run: npm run build
7473

lib/tags/assertions.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ module.exports = function yields (hexo, args) {
1111
const type = args[0]
1212
const cmd = `<code>${args[1]}()</code>`
1313

14-
/* eslint-disable commas */
1514
const waitAssertions = `${cmd} will automatically wait for assertions you've chained to pass`
1615

17-
/* eslint-disable commas */
1816
const retryAssertions = `${cmd} will automatically {% url "retry" retry-ability %} until assertions you've chained all pass`
1917

20-
/* eslint-disable quotes */
2118
const exist = `${cmd} will automatically {% url "retry" retry-ability %} until the element(s) {% url 'exist in the DOM' introduction-to-cypress#Default-Assertions %}`
2219

23-
/* eslint-disable quotes */
2420
const actionable = `${cmd} will automatically wait for the element to reach an {% url 'actionable state' interacting-with-elements %}`
2521

2622
const render = (str) => {

lib/tags/partial.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ const rawRender = require('../raw_render')
44

55
module.exports = function partial (hexo, fileName) {
66
const pathToFile = path.resolve('source', '_partial', `${fileName}.md`)
7-
7+
88
return new Promise((resolve, reject) => {
99
fs.readFile(pathToFile, (err, data) => {
1010
if (err) reject(err)
11+
1112
resolve(rawRender(hexo, data.toString(), { engine: 'markdown' }))
1213
})
1314
})

0 commit comments

Comments
 (0)