diff --git a/.eslintignore b/.eslintignore index c50ce0052813..45d0e83020f6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,7 +7,12 @@ **/dist **/dist-test **/node_modules -**/support/fixtures +**/support/fixtures/* +!**/support/fixtures/projects +**/support/fixtures/projects/**/_fixtures/* +**/support/fixtures/projects/**/*.jsx +**/support/fixtures/projects/**/jquery.js +**/support/fixtures/projects/**/fail.js **/test/fixtures **/vendor diff --git a/packages/server/test/support/fixtures/projects/busted-support-file/cypress/support/index.js b/packages/server/test/support/fixtures/projects/busted-support-file/cypress/support/index.js index b634e9380711..fbab6df357e4 100644 --- a/packages/server/test/support/fixtures/projects/busted-support-file/cypress/support/index.js +++ b/packages/server/test/support/fixtures/projects/busted-support-file/cypress/support/index.js @@ -1 +1 @@ -import "./does/not/exist" \ No newline at end of file +import './does/not/exist' diff --git a/packages/server/test/support/fixtures/projects/default-layout/cypress/integration/default_layout_spec.js b/packages/server/test/support/fixtures/projects/default-layout/cypress/integration/default_layout_spec.js index e2fbbbe9ab71..7e5e612bae4e 100644 --- a/packages/server/test/support/fixtures/projects/default-layout/cypress/integration/default_layout_spec.js +++ b/packages/server/test/support/fixtures/projects/default-layout/cypress/integration/default_layout_spec.js @@ -1 +1,2 @@ +/* eslint-disable mocha/no-global-tests */ it('works', () => {}) diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js index 16a6f89e5e57..8bcc6576e58b 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js @@ -1 +1 @@ -import "../../lib/fail" \ No newline at end of file +import '../../lib/fail' diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/https_passthru_spec.js b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/https_passthru_spec.js index ae3a83c6480d..b7315852265f 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/https_passthru_spec.js +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/https_passthru_spec.js @@ -23,6 +23,7 @@ describe('https passthru retries', () => { img.onload = () => { reject(new Error('onload event fired, but should not have. expected onerror to fire.')) } + img.onerror = resolve }) }) diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/network_error_handling_spec.js b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/network_error_handling_spec.js index b62f31b30c8c..318ddc13ae52 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/network_error_handling_spec.js +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/network_error_handling_spec.js @@ -27,8 +27,10 @@ describe('network error handling', function () { }) .get('input[type=text]') .type('bar') + cy.get('input[type=submit]') .click() + cy.contains('{"foo":"bar"}') }) }) diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/plugins/index.js b/packages/server/test/support/fixtures/projects/e2e/cypress/plugins/index.js index ed471c9b69e3..2d920c90a544 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/plugins/index.js +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/plugins/index.js @@ -101,6 +101,7 @@ module.exports = (on) => { 'record:fast_visit_spec' ({ percentiles, url, browser, currentRetry }) { percentiles.forEach(([percent, percentile]) => { + // eslint-disable-next-line no-console console.log(`${percent}%\t of visits to ${url} finished in less than ${percentile}ms`) }) @@ -110,8 +111,9 @@ module.exports = (on) => { currentRetry, ...percentiles.reduce((acc, pair) => { acc[pair[0]] = pair[1] + return acc - }, {}) + }, {}), } return performance.track('fast_visit_spec percentiles', data) diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/support/foo/bar.js b/packages/server/test/support/fixtures/projects/e2e/cypress/support/foo/bar.js index be19a41deb62..80446ed767db 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/support/foo/bar.js +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/support/foo/bar.js @@ -1 +1,2 @@ -console.log("bar") \ No newline at end of file +/* eslint-disable no-console */ +console.log('bar') diff --git a/packages/server/test/support/fixtures/projects/e2e/lib/bar.js b/packages/server/test/support/fixtures/projects/e2e/lib/bar.js index b6a1e32eb015..fec0747a32df 100644 --- a/packages/server/test/support/fixtures/projects/e2e/lib/bar.js +++ b/packages/server/test/support/fixtures/projects/e2e/lib/bar.js @@ -1,3 +1,3 @@ -import baz from "./baz" +import baz from './baz' -export default baz \ No newline at end of file +export default baz diff --git a/packages/server/test/support/fixtures/projects/e2e/lib/baz.js b/packages/server/test/support/fixtures/projects/e2e/lib/baz.js index 1ddc68846578..72796455a560 100644 --- a/packages/server/test/support/fixtures/projects/e2e/lib/baz.js +++ b/packages/server/test/support/fixtures/projects/e2e/lib/baz.js @@ -1,3 +1,3 @@ export default () => { - return "baz" -} \ No newline at end of file + return 'baz' +} diff --git a/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js b/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js index b8577e357f5e..af6bdba91c33 100644 --- a/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js +++ b/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ module.exports = function Reporter (runner) { runner.on('test end', function (test) { console.log(test.title) diff --git a/packages/server/test/support/fixtures/projects/ids/cypress/integration/bar.js b/packages/server/test/support/fixtures/projects/ids/cypress/integration/bar.js index 62dbdba0395b..1b64ff8bcc23 100644 --- a/packages/server/test/support/fixtures/projects/ids/cypress/integration/bar.js +++ b/packages/server/test/support/fixtures/projects/ids/cypress/integration/bar.js @@ -1,3 +1,3 @@ -context("some context[i9w]", function(){ +context('some context[i9w]', function () { it('tests[abc]') -}) \ No newline at end of file +}) diff --git a/packages/server/test/support/fixtures/projects/ids/cypress/integration/baz.js b/packages/server/test/support/fixtures/projects/ids/cypress/integration/baz.js index fb5b944d2aac..fd32a7c442d5 100644 --- a/packages/server/test/support/fixtures/projects/ids/cypress/integration/baz.js +++ b/packages/server/test/support/fixtures/projects/ids/cypress/integration/baz.js @@ -1 +1 @@ -import "./dom.jsx" \ No newline at end of file +import './dom.jsx' diff --git a/packages/server/test/support/fixtures/projects/multiple-task-registrations/cypress/plugins/index.js b/packages/server/test/support/fixtures/projects/multiple-task-registrations/cypress/plugins/index.js index 2979d06e965d..8c66f332da02 100644 --- a/packages/server/test/support/fixtures/projects/multiple-task-registrations/cypress/plugins/index.js +++ b/packages/server/test/support/fixtures/projects/multiple-task-registrations/cypress/plugins/index.js @@ -1,11 +1,19 @@ module.exports = (on) => { on('task', { - 'one' () { return 'one' }, - 'two' () { return 'two' }, + 'one' () { + return 'one' + }, + 'two' () { + return 'two' + }, }) on('task', { - 'two' () { return 'two again' }, - 'three' () { return 'three' }, + 'two' () { + return 'two again' + }, + 'three' () { + return 'three' + }, }) } diff --git a/packages/server/test/support/fixtures/projects/no-server/helpers/includes.js b/packages/server/test/support/fixtures/projects/no-server/helpers/includes.js index 03f300c4fa91..81969706f702 100644 --- a/packages/server/test/support/fixtures/projects/no-server/helpers/includes.js +++ b/packages/server/test/support/fixtures/projects/no-server/helpers/includes.js @@ -1,3 +1,3 @@ -beforeEach(function(){ +beforeEach(function () { -}); \ No newline at end of file +}) diff --git a/packages/server/test/support/fixtures/projects/no-server/my-tests/test1.js b/packages/server/test/support/fixtures/projects/no-server/my-tests/test1.js index d995e2b550f8..e3a5395eee36 100644 --- a/packages/server/test/support/fixtures/projects/no-server/my-tests/test1.js +++ b/packages/server/test/support/fixtures/projects/no-server/my-tests/test1.js @@ -1,3 +1,4 @@ -it("tests without a server", function(){ +/* eslint-disable mocha/no-global-tests */ +it('tests without a server', function () { -}); \ No newline at end of file +}) diff --git a/packages/server/test/support/fixtures/projects/plugin-extension/ext/background.js b/packages/server/test/support/fixtures/projects/plugin-extension/ext/background.js index aa1a7bbebb23..c8bd7e7d9306 100644 --- a/packages/server/test/support/fixtures/projects/plugin-extension/ext/background.js +++ b/packages/server/test/support/fixtures/projects/plugin-extension/ext/background.js @@ -1,5 +1,3 @@ -/* global document */ - const el = document.getElementById('extension') if (el) { diff --git a/packages/server/test/support/fixtures/projects/plugin-extension/ext/manifest.json b/packages/server/test/support/fixtures/projects/plugin-extension/ext/manifest.json index f99b8dac309a..68a6c0163a9c 100644 --- a/packages/server/test/support/fixtures/projects/plugin-extension/ext/manifest.json +++ b/packages/server/test/support/fixtures/projects/plugin-extension/ext/manifest.json @@ -3,16 +3,22 @@ "version": "0", "description": "tests adding user extension into Cypress", "permissions": [ - "tabs", "webNavigation", "" + "tabs", + "webNavigation", + "" ], "content_scripts": [ { - "matches": [""], + "matches": [ + "" + ], "exclude_matches": [ "*://*/__cypress/*", "*://*/__/*" ], - "js": ["background.js"], + "js": [ + "background.js" + ], "run_at": "document_end", "all_frames": true } diff --git a/packages/server/test/support/fixtures/projects/plugins-async-error/cypress/plugins/index.js b/packages/server/test/support/fixtures/projects/plugins-async-error/cypress/plugins/index.js index 30ae36270881..9689fd8b504b 100644 --- a/packages/server/test/support/fixtures/projects/plugins-async-error/cypress/plugins/index.js +++ b/packages/server/test/support/fixtures/projects/plugins-async-error/cypress/plugins/index.js @@ -1,5 +1,3 @@ -/* global Promise */ - module.exports = (on) => { on('file:preprocessor', () => { return new Promise(() => { diff --git a/packages/server/test/support/fixtures/projects/todos/tests/test1.js b/packages/server/test/support/fixtures/projects/todos/tests/test1.js index 06281e2ddb99..e5b9547cd65a 100644 --- a/packages/server/test/support/fixtures/projects/todos/tests/test1.js +++ b/packages/server/test/support/fixtures/projects/todos/tests/test1.js @@ -1,3 +1,4 @@ -it("is truthy", function(){ +/* eslint-disable mocha/no-global-tests */ +it('is truthy', function () { expect(true).to.be.true -}) \ No newline at end of file +}) diff --git a/packages/server/test/support/fixtures/projects/working-preprocessor/cypress/integration/another_spec.js b/packages/server/test/support/fixtures/projects/working-preprocessor/cypress/integration/another_spec.js index e67642893051..7bf33f67833f 100644 --- a/packages/server/test/support/fixtures/projects/working-preprocessor/cypress/integration/another_spec.js +++ b/packages/server/test/support/fixtures/projects/working-preprocessor/cypress/integration/another_spec.js @@ -1,5 +1,4 @@ -/* global it, expect */ - +/* eslint-disable mocha/no-global-tests */ it('is another spec', () => { expect(false).to.be.false })