mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-06 06:50:29 -05:00
ci: Use eslint plugin to catch .only in tests (#9624)
Co-authored-by: Gleb Bahmutov <bahmutov@yahoo.com>
This commit is contained in:
+3
-1
@@ -1,11 +1,13 @@
|
||||
{
|
||||
"plugins": [
|
||||
"@cypress/dev"
|
||||
"@cypress/dev",
|
||||
"no-only-tests"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:@cypress/dev/general"
|
||||
],
|
||||
"rules": {
|
||||
"no-only-tests/no-only-tests": "warn",
|
||||
"prefer-spread": "off",
|
||||
"prefer-rest-params": "off"
|
||||
},
|
||||
|
||||
+1
-7
@@ -439,12 +439,6 @@ jobs:
|
||||
. ./scripts/load-nvm.sh
|
||||
yarn check-terminal
|
||||
|
||||
- run:
|
||||
name: Stop .only
|
||||
command: |
|
||||
. ./scripts/load-nvm.sh
|
||||
yarn stop-only-all
|
||||
|
||||
- restore_cache:
|
||||
name: Restore yarn cache
|
||||
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-deps-root-{{ checksum "yarn.lock" }}
|
||||
@@ -491,7 +485,7 @@ jobs:
|
||||
command: |
|
||||
. ./scripts/load-nvm.sh
|
||||
git clean -df
|
||||
yarn lint
|
||||
yarn lint --max-warnings=0
|
||||
- run:
|
||||
name: cypress info (dev)
|
||||
command: node cli/bin/cypress info --dev
|
||||
|
||||
+2
-6
@@ -47,8 +47,6 @@
|
||||
"set-next-ci-version": "node ./scripts/binary.js setNextVersion",
|
||||
"prestart": "yarn ensure-deps",
|
||||
"start": "node $(yarn bin cypress) open --dev --global",
|
||||
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src --exclude e2e.ts,cypress-tests.ts",
|
||||
"stop-only-all": "yarn stop-only --folder packages",
|
||||
"pretest": "yarn ensure-deps",
|
||||
"test": "yarn lerna exec yarn test --scope cypress --scope \"'@packages/{electron,extension,https-proxy,launcher,net-stubbing,network,proxy,rewriter,runner,socket}'\"",
|
||||
"test-debug": "lerna exec yarn test-debug --ignore \"'@packages/{desktop-gui,driver,root,static,web-config}'\"",
|
||||
@@ -133,6 +131,7 @@
|
||||
"eslint-plugin-cypress": "2.11.1",
|
||||
"eslint-plugin-json-format": "2.0.0",
|
||||
"eslint-plugin-mocha": "6.1.0",
|
||||
"eslint-plugin-no-only-tests": "^2.4.0",
|
||||
"eslint-plugin-react": "7.18.3",
|
||||
"execa": "4.0.0",
|
||||
"execa-wrap": "1.4.0",
|
||||
@@ -187,7 +186,6 @@
|
||||
"sinon": "7.3.2",
|
||||
"snap-shot-it": "7.9.3",
|
||||
"start-server-and-test": "1.10.8",
|
||||
"stop-only": "3.0.1",
|
||||
"strip-ansi": "4.0.0",
|
||||
"term-to-html": "1.2.0",
|
||||
"terminal-banner": "1.1.0",
|
||||
@@ -238,12 +236,10 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.coffee": [
|
||||
"yarn stop-only --folder",
|
||||
"git add"
|
||||
],
|
||||
"*.{js,jsx,ts,tsx,json,eslintrc}": [
|
||||
"yarn stop-only --folder",
|
||||
"eslint --fix",
|
||||
"eslint --fix --max-warnings=0",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -270,6 +270,7 @@ const getMochaItFn = function (only, skip, browser, specifiedBrowser) {
|
||||
}
|
||||
|
||||
if (only) {
|
||||
// eslint-disable-next-line no-only-tests/no-only-tests
|
||||
return it.only
|
||||
}
|
||||
|
||||
|
||||
@@ -14184,6 +14184,11 @@ eslint-plugin-mocha@^5.3.0:
|
||||
dependencies:
|
||||
ramda "^0.26.1"
|
||||
|
||||
eslint-plugin-no-only-tests@^2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.4.0.tgz#7d565434aa7d16ccc7eea957c391d98f827332ca"
|
||||
integrity sha512-azP9PwQYfGtXJjW273nIxQH9Ygr+5/UyeW2wEjYoDtVYPI+WPKwbj0+qcAKYUXFZLRumq4HKkFaoDBAwBoXImQ==
|
||||
|
||||
eslint-plugin-promise@^4.2.1:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a"
|
||||
@@ -14577,19 +14582,6 @@ execa@0.10.0, execa@^0.10.0:
|
||||
signal-exit "^3.0.0"
|
||||
strip-eof "^1.0.0"
|
||||
|
||||
execa@0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-0.11.0.tgz#0b3c71daf9b9159c252a863cd981af1b4410d97a"
|
||||
integrity sha512-k5AR22vCt1DcfeiRixW46U5tMLtBg44ssdJM9PiXw3D8Bn5qyxFCSnKY/eR22y+ctFDGPqafpaXg2G4Emyua4A==
|
||||
dependencies:
|
||||
cross-spawn "^6.0.0"
|
||||
get-stream "^4.0.0"
|
||||
is-stream "^1.1.0"
|
||||
npm-run-path "^2.0.0"
|
||||
p-finally "^1.0.0"
|
||||
signal-exit "^3.0.0"
|
||||
strip-eof "^1.0.0"
|
||||
|
||||
execa@0.8.0, execa@^0.8.0:
|
||||
version "0.8.0"
|
||||
resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da"
|
||||
@@ -30084,15 +30076,6 @@ stealthy-require@^1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
|
||||
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
|
||||
|
||||
stop-only@3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/stop-only/-/stop-only-3.0.1.tgz#480176c2712d59373eff6accc8de5fbff960c2ee"
|
||||
integrity sha512-B38Y/K0QbnAbE3llvP4WkjzdN4QkgAHMLC/FxQyPMOC/X6SLrGjRsqFiebkrt6fqQnD9jdp8QpMIdQWMuUYEhA==
|
||||
dependencies:
|
||||
debug "4.1.1"
|
||||
execa "0.11.0"
|
||||
minimist "1.2.0"
|
||||
|
||||
stream-browserify@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f"
|
||||
|
||||
Reference in New Issue
Block a user