diff --git a/packages/desktop-gui/cypress/support/index.js b/packages/desktop-gui/cypress/support/index.js index 23acc3ad7a..f81291bfc7 100644 --- a/packages/desktop-gui/cypress/support/index.js +++ b/packages/desktop-gui/cypress/support/index.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('@percy/cypress') require('cypress-react-unit-test/dist/hooks') diff --git a/packages/extension/test/.eslintrc.json b/packages/extension/test/.eslintrc.json index b5ed5206d0..7e8e439b6d 100644 --- a/packages/extension/test/.eslintrc.json +++ b/packages/extension/test/.eslintrc.json @@ -1,5 +1,8 @@ { "extends": [ "plugin:@cypress/dev/tests" - ] + ], + "globals": { + "sinon": true + } } diff --git a/packages/extension/test/integration/background_spec.js b/packages/extension/test/integration/background_spec.js index 262d44e40c..caade93e56 100644 --- a/packages/extension/test/integration/background_spec.js +++ b/packages/extension/test/integration/background_spec.js @@ -1,15 +1,3 @@ -/* eslint-disable - brace-style, - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') const http = require('http') @@ -178,7 +166,7 @@ describe('app/background', () => { it('emits \'automation:push:request\'', (done) => { const info = { cause: 'explicit', cookie: { name: 'foo', value: 'bar' } } - const addListener = sinon.stub(browser.cookies.onChanged, 'addListener').yieldsAsync(info) + sinon.stub(browser.cookies.onChanged, 'addListener').yieldsAsync(info) const client = background.connect(`http://localhost:${PORT}`, '/__socket.io') return client.on('connect', () => { @@ -259,8 +247,8 @@ describe('app/background', () => { }) .then(() => { throw new Error('should have failed') - }).catch((err) => // we good if this hits - { + }).catch((err) => { + // we good if this hits expect(err).to.be.instanceof(Promise.RangeError) }) }) @@ -300,8 +288,8 @@ describe('app/background', () => { }) .then(() => { throw new Error('should have failed') - }).catch((err) => // we good if this hits - { + }).catch((err) => { + // we good if this hits expect(err).to.be.instanceof(Promise.RangeError) }) }) diff --git a/packages/extension/test/spec_helper.js b/packages/extension/test/spec_helper.js index 689ea624e0..020b86c513 100644 --- a/packages/extension/test/spec_helper.js +++ b/packages/extension/test/spec_helper.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const chai = require('chai') const sinon = require('sinon') const sinonChai = require('sinon-chai') diff --git a/packages/extension/test/unit/extension_spec.js b/packages/extension/test/unit/extension_spec.js index 30673193b2..4736323e39 100644 --- a/packages/extension/test/unit/extension_spec.js +++ b/packages/extension/test/unit/extension_spec.js @@ -1,21 +1,7 @@ -/* eslint-disable - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') -let { - exec, -} = require('child_process') +let { exec } = require('child_process') let fs = require('fs-extra') -const EE = require('events') const eol = require('eol') const path = require('path') const Promise = require('bluebird') diff --git a/packages/reporter/cypress/integration/aliases_spec.js b/packages/reporter/cypress/integration/aliases_spec.js index 9d7ec9af74..70bd052a9a 100644 --- a/packages/reporter/cypress/integration/aliases_spec.js +++ b/packages/reporter/cypress/integration/aliases_spec.js @@ -1,14 +1,5 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const { EventEmitter } = require('events') -const { - _, -} = Cypress +const { _ } = Cypress const addLog = function (runner, log) { const defaultLog = { @@ -40,7 +31,7 @@ describe('aliases', () => { }) }) - return cy.get('.reporter').then(() => { + cy.get('.reporter').then(() => { this.runner.emit('runnables:ready', this.runnables) return this.runner.emit('reporter:start', {}) @@ -71,7 +62,7 @@ describe('aliases', () => { }) it('has correct alias class', () => { - return cy.contains('.command-number', '1') + cy.contains('.command-number', '1') .parent() .find('.command-alias') .should('have.class', 'route') @@ -83,11 +74,11 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@getUsers') + cy.contains('.command-alias', '@getUsers') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found an alias for: \'getUsers\'') }) }) @@ -137,7 +128,7 @@ describe('aliases', () => { }) it('renders all aliases ', () => { - return cy.get('.command-alias').should('have.length', 3) + cy.get('.command-alias').should('have.length', 3) }) it('render with counts in non-event commands', () => { @@ -146,7 +137,7 @@ describe('aliases', () => { .within(() => { cy.contains('.command-alias-count', '1') - return cy.contains('.command-alias', '@getPosts') + cy.contains('.command-alias', '@getPosts') .trigger('mouseover') }) @@ -159,22 +150,22 @@ describe('aliases', () => { .within(() => { cy.contains('.command-alias-count', '2') - return cy.contains('.command-alias', '@getPosts') + cy.contains('.command-alias', '@getPosts') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found 2nd alias for: \'getPosts\'') }) }) it('render with counts in event commands when collapsed', () => { - return cy.get('.command-wrapper') + cy.get('.command-wrapper') .first() .within(() => { cy.contains('.num-duplicates', '2') - return cy.contains('.command-alias', 'getPosts') + cy.contains('.command-alias', 'getPosts') }) }) @@ -183,12 +174,12 @@ describe('aliases', () => { .first() .click() - return cy.get('.command-wrapper') + cy.get('.command-wrapper') .first() .within(($commandWrapper) => { cy.get('.num-duplicates').should('not.be.visible') - return cy.contains('.command-alias', 'getPosts') + cy.contains('.command-alias', 'getPosts') }) }) }) @@ -262,7 +253,7 @@ describe('aliases', () => { .within(() => { cy.contains('.command-alias-count', '1') - return cy.contains('.command-alias', '@getPosts') + cy.contains('.command-alias', '@getPosts') .trigger('mouseover') }) @@ -275,11 +266,11 @@ describe('aliases', () => { .within(() => { cy.contains('.command-alias-count', '2') - return cy.contains('.command-alias', '@getPosts') + cy.contains('.command-alias', '@getPosts') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found 2nd alias for: \'getPosts\'') }) }) @@ -299,7 +290,7 @@ describe('aliases', () => { }) }) - return cy.get('.reporter').then(() => { + cy.get('.reporter').then(() => { this.runner.emit('runnables:ready', this.runnables) return this.runner.emit('reporter:start', {}) @@ -331,7 +322,7 @@ describe('aliases', () => { }) it('has correct alias class', () => { - return cy.contains('.command-number', '1') + cy.contains('.command-number', '1') .parent() .find('.command-alias') .should('have.class', 'dom') @@ -343,11 +334,11 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@barAlias') + cy.contains('.command-alias', '@barAlias') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found an alias for: \'barAlias\'') }) }) @@ -404,7 +395,7 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@dropdown') + cy.contains('.command-alias', '@dropdown') .trigger('mouseover') }) @@ -417,22 +408,22 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@dropdown') + cy.contains('.command-alias', '@dropdown') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found an alias for: \'dropdown\'') }) }) it('render without counts in event commands when collapsed', () => { - return cy.get('.command-wrapper') + cy.get('.command-wrapper') .first() .within(() => { cy.get('.num-duplicates').should('not.be.visible') - return cy.contains('.command-alias', 'dropdown') + cy.contains('.command-alias', 'dropdown') }) }) }) @@ -504,7 +495,7 @@ describe('aliases', () => { }) it('renders all aliases ', () => { - return cy.get('.command-alias').should('have.length', 6) + cy.get('.command-alias').should('have.length', 6) }) it('render without counts', () => { @@ -513,7 +504,7 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@dropdown') + cy.contains('.command-alias', '@dropdown') .trigger('mouseover') }) @@ -526,11 +517,11 @@ describe('aliases', () => { .within(() => { cy.get('.command-alias-count').should('not.exist') - return cy.contains('.command-alias', '@dropdown') + cy.contains('.command-alias', '@dropdown') .trigger('mouseover') }) - return cy.get('.cy-tooltip span').should(($tooltip) => { + cy.get('.cy-tooltip span').should(($tooltip) => { expect($tooltip).to.contain('Found an alias for: \'dropdown\'') }) }) diff --git a/packages/server/__snapshots__/1_async_timeouts_spec.coffee.js b/packages/server/__snapshots__/1_async_timeouts_spec.js similarity index 100% rename from packages/server/__snapshots__/1_async_timeouts_spec.coffee.js rename to packages/server/__snapshots__/1_async_timeouts_spec.js diff --git a/packages/server/__snapshots__/1_base_url_spec.coffee.js b/packages/server/__snapshots__/1_base_url_spec.js similarity index 100% rename from packages/server/__snapshots__/1_base_url_spec.coffee.js rename to packages/server/__snapshots__/1_base_url_spec.js diff --git a/packages/server/__snapshots__/1_blacklist_hosts_spec.coffee.js b/packages/server/__snapshots__/1_blacklist_hosts_spec.js similarity index 100% rename from packages/server/__snapshots__/1_blacklist_hosts_spec.coffee.js rename to packages/server/__snapshots__/1_blacklist_hosts_spec.js diff --git a/packages/server/__snapshots__/1_browserify_babel_es201_spec.coffee.js b/packages/server/__snapshots__/1_browserify_babel_es201_spec.js similarity index 100% rename from packages/server/__snapshots__/1_browserify_babel_es201_spec.coffee.js rename to packages/server/__snapshots__/1_browserify_babel_es201_spec.js diff --git a/packages/server/__snapshots__/1_busted_support_file_spec.coffee.js b/packages/server/__snapshots__/1_busted_support_file_spec.js similarity index 100% rename from packages/server/__snapshots__/1_busted_support_file_spec.coffee.js rename to packages/server/__snapshots__/1_busted_support_file_spec.js diff --git a/packages/server/__snapshots__/1_cache_spec.coffee.js b/packages/server/__snapshots__/1_cache_spec.js similarity index 100% rename from packages/server/__snapshots__/1_cache_spec.coffee.js rename to packages/server/__snapshots__/1_cache_spec.js diff --git a/packages/server/__snapshots__/1_caught_uncaught_hook_errors_spec.coffee.js b/packages/server/__snapshots__/1_caught_uncaught_hook_errors_spec.js similarity index 100% rename from packages/server/__snapshots__/1_caught_uncaught_hook_errors_spec.coffee.js rename to packages/server/__snapshots__/1_caught_uncaught_hook_errors_spec.js diff --git a/packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js b/packages/server/__snapshots__/1_commands_outside_of_test_spec.js similarity index 100% rename from packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js rename to packages/server/__snapshots__/1_commands_outside_of_test_spec.js diff --git a/packages/server/__snapshots__/1_interception_spec.coffee.js b/packages/server/__snapshots__/1_interception_spec.js similarity index 100% rename from packages/server/__snapshots__/1_interception_spec.coffee.js rename to packages/server/__snapshots__/1_interception_spec.js diff --git a/packages/server/__snapshots__/1_system_node_spec.coffee.js b/packages/server/__snapshots__/1_system_node_spec.js similarity index 100% rename from packages/server/__snapshots__/1_system_node_spec.coffee.js rename to packages/server/__snapshots__/1_system_node_spec.js diff --git a/packages/server/__snapshots__/1_typescript_support_spec.coffee.js b/packages/server/__snapshots__/1_typescript_support_spec.js similarity index 100% rename from packages/server/__snapshots__/1_typescript_support_spec.coffee.js rename to packages/server/__snapshots__/1_typescript_support_spec.js diff --git a/packages/server/__snapshots__/2_cookies_spec.coffee.js b/packages/server/__snapshots__/2_cookies_spec.js similarity index 100% rename from packages/server/__snapshots__/2_cookies_spec.coffee.js rename to packages/server/__snapshots__/2_cookies_spec.js diff --git a/packages/server/__snapshots__/2_go_spec.coffee.js b/packages/server/__snapshots__/2_go_spec.js similarity index 100% rename from packages/server/__snapshots__/2_go_spec.coffee.js rename to packages/server/__snapshots__/2_go_spec.js diff --git a/packages/server/__snapshots__/2_iframe_spec.coffee.js b/packages/server/__snapshots__/2_iframe_spec.js similarity index 100% rename from packages/server/__snapshots__/2_iframe_spec.coffee.js rename to packages/server/__snapshots__/2_iframe_spec.js diff --git a/packages/server/__snapshots__/2_images_spec.coffee.js b/packages/server/__snapshots__/2_images_spec.js similarity index 100% rename from packages/server/__snapshots__/2_images_spec.coffee.js rename to packages/server/__snapshots__/2_images_spec.js diff --git a/packages/server/__snapshots__/3_config_spec.coffee.js b/packages/server/__snapshots__/3_config_spec.js similarity index 100% rename from packages/server/__snapshots__/3_config_spec.coffee.js rename to packages/server/__snapshots__/3_config_spec.js diff --git a/packages/server/__snapshots__/3_issue_149_spec.coffee.js b/packages/server/__snapshots__/3_issue_149_spec.js similarity index 100% rename from packages/server/__snapshots__/3_issue_149_spec.coffee.js rename to packages/server/__snapshots__/3_issue_149_spec.js diff --git a/packages/server/__snapshots__/3_issue_1669_spec.coffee.js b/packages/server/__snapshots__/3_issue_1669_spec.js similarity index 100% rename from packages/server/__snapshots__/3_issue_1669_spec.coffee.js rename to packages/server/__snapshots__/3_issue_1669_spec.js diff --git a/packages/server/__snapshots__/3_issue_173_spec.coffee.js b/packages/server/__snapshots__/3_issue_173_spec.js similarity index 100% rename from packages/server/__snapshots__/3_issue_173_spec.coffee.js rename to packages/server/__snapshots__/3_issue_173_spec.js diff --git a/packages/server/__snapshots__/3_issue_2891_spec.coffee.js b/packages/server/__snapshots__/3_issue_2891_spec.js similarity index 100% rename from packages/server/__snapshots__/3_issue_2891_spec.coffee.js rename to packages/server/__snapshots__/3_issue_2891_spec.js diff --git a/packages/server/__snapshots__/3_issue_674_spec.coffee.js b/packages/server/__snapshots__/3_issue_674_spec.js similarity index 100% rename from packages/server/__snapshots__/3_issue_674_spec.coffee.js rename to packages/server/__snapshots__/3_issue_674_spec.js diff --git a/packages/server/__snapshots__/3_js_error_handling_spec.coffee.js b/packages/server/__snapshots__/3_js_error_handling_spec.js similarity index 100% rename from packages/server/__snapshots__/3_js_error_handling_spec.coffee.js rename to packages/server/__snapshots__/3_js_error_handling_spec.js diff --git a/packages/server/__snapshots__/3_new_project_spec.coffee.js b/packages/server/__snapshots__/3_new_project_spec.js similarity index 100% rename from packages/server/__snapshots__/3_new_project_spec.coffee.js rename to packages/server/__snapshots__/3_new_project_spec.js diff --git a/packages/server/__snapshots__/3_only_spec.coffee.js b/packages/server/__snapshots__/3_only_spec.js similarity index 100% rename from packages/server/__snapshots__/3_only_spec.coffee.js rename to packages/server/__snapshots__/3_only_spec.js diff --git a/packages/server/__snapshots__/3_page_loading_spec.coffee.js b/packages/server/__snapshots__/3_page_loading_spec.js similarity index 100% rename from packages/server/__snapshots__/3_page_loading_spec.coffee.js rename to packages/server/__snapshots__/3_page_loading_spec.js diff --git a/packages/server/__snapshots__/3_user_agent_spec.coffee.js b/packages/server/__snapshots__/3_user_agent_spec.js similarity index 100% rename from packages/server/__snapshots__/3_user_agent_spec.coffee.js rename to packages/server/__snapshots__/3_user_agent_spec.js diff --git a/packages/server/__snapshots__/4_browser_path_spec.coffee.js b/packages/server/__snapshots__/4_browser_path_spec.js similarity index 100% rename from packages/server/__snapshots__/4_browser_path_spec.coffee.js rename to packages/server/__snapshots__/4_browser_path_spec.js diff --git a/packages/server/__snapshots__/4_controllers_spec.coffee.js b/packages/server/__snapshots__/4_controllers_spec.js similarity index 100% rename from packages/server/__snapshots__/4_controllers_spec.coffee.js rename to packages/server/__snapshots__/4_controllers_spec.js diff --git a/packages/server/__snapshots__/4_domain_spec.coffee.js b/packages/server/__snapshots__/4_domain_spec.js similarity index 100% rename from packages/server/__snapshots__/4_domain_spec.coffee.js rename to packages/server/__snapshots__/4_domain_spec.js diff --git a/packages/server/__snapshots__/4_form_submissions_spec.coffee.js b/packages/server/__snapshots__/4_form_submissions_spec.js similarity index 100% rename from packages/server/__snapshots__/4_form_submissions_spec.coffee.js rename to packages/server/__snapshots__/4_form_submissions_spec.js diff --git a/packages/server/__snapshots__/4_promises_spec.coffee.js b/packages/server/__snapshots__/4_promises_spec.js similarity index 100% rename from packages/server/__snapshots__/4_promises_spec.coffee.js rename to packages/server/__snapshots__/4_promises_spec.js diff --git a/packages/server/__snapshots__/4_request_spec.coffee.js b/packages/server/__snapshots__/4_request_spec.js similarity index 100% rename from packages/server/__snapshots__/4_request_spec.coffee.js rename to packages/server/__snapshots__/4_request_spec.js diff --git a/packages/server/__snapshots__/4_return_value_spec.coffee.js b/packages/server/__snapshots__/4_return_value_spec.js similarity index 100% rename from packages/server/__snapshots__/4_return_value_spec.coffee.js rename to packages/server/__snapshots__/4_return_value_spec.js diff --git a/packages/server/__snapshots__/4_screenshot_element_capture_spec.coffee.js b/packages/server/__snapshots__/4_screenshot_element_capture_spec.js similarity index 100% rename from packages/server/__snapshots__/4_screenshot_element_capture_spec.coffee.js rename to packages/server/__snapshots__/4_screenshot_element_capture_spec.js diff --git a/packages/server/__snapshots__/4_screenshot_fullpage_capture_spec.coffee.js b/packages/server/__snapshots__/4_screenshot_fullpage_capture_spec.js similarity index 100% rename from packages/server/__snapshots__/4_screenshot_fullpage_capture_spec.coffee.js rename to packages/server/__snapshots__/4_screenshot_fullpage_capture_spec.js diff --git a/packages/server/__snapshots__/4_screenshot_nested_file_spec.coffee.js b/packages/server/__snapshots__/4_screenshot_nested_file_spec.js similarity index 100% rename from packages/server/__snapshots__/4_screenshot_nested_file_spec.coffee.js rename to packages/server/__snapshots__/4_screenshot_nested_file_spec.js diff --git a/packages/server/__snapshots__/4_websockets_spec.coffee.js b/packages/server/__snapshots__/4_websockets_spec.js similarity index 100% rename from packages/server/__snapshots__/4_websockets_spec.coffee.js rename to packages/server/__snapshots__/4_websockets_spec.js diff --git a/packages/server/__snapshots__/4_xhr_spec.coffee.js b/packages/server/__snapshots__/4_xhr_spec.js similarity index 100% rename from packages/server/__snapshots__/4_xhr_spec.coffee.js rename to packages/server/__snapshots__/4_xhr_spec.js diff --git a/packages/server/__snapshots__/5_screenshot_viewport_capture_spec.coffee.js b/packages/server/__snapshots__/5_screenshot_viewport_capture_spec.js similarity index 100% rename from packages/server/__snapshots__/5_screenshot_viewport_capture_spec.coffee.js rename to packages/server/__snapshots__/5_screenshot_viewport_capture_spec.js diff --git a/packages/server/__snapshots__/5_screenshots_spec.coffee.js b/packages/server/__snapshots__/5_screenshots_spec.js similarity index 100% rename from packages/server/__snapshots__/5_screenshots_spec.coffee.js rename to packages/server/__snapshots__/5_screenshots_spec.js diff --git a/packages/server/__snapshots__/5_server_sent_events_spec.coffee.js b/packages/server/__snapshots__/5_server_sent_events_spec.js similarity index 100% rename from packages/server/__snapshots__/5_server_sent_events_spec.coffee.js rename to packages/server/__snapshots__/5_server_sent_events_spec.js diff --git a/packages/server/__snapshots__/5_spec_isolation_spec.coffee.js b/packages/server/__snapshots__/5_spec_isolation_spec.js similarity index 100% rename from packages/server/__snapshots__/5_spec_isolation_spec.coffee.js rename to packages/server/__snapshots__/5_spec_isolation_spec.js diff --git a/packages/server/__snapshots__/5_specs_spec.coffee.js b/packages/server/__snapshots__/5_specs_spec.js similarity index 100% rename from packages/server/__snapshots__/5_specs_spec.coffee.js rename to packages/server/__snapshots__/5_specs_spec.js diff --git a/packages/server/__snapshots__/5_stdout_spec.coffee.js b/packages/server/__snapshots__/5_stdout_spec.js similarity index 100% rename from packages/server/__snapshots__/5_stdout_spec.coffee.js rename to packages/server/__snapshots__/5_stdout_spec.js diff --git a/packages/server/__snapshots__/5_subdomain_spec.coffee.js b/packages/server/__snapshots__/5_subdomain_spec.js similarity index 100% rename from packages/server/__snapshots__/5_subdomain_spec.coffee.js rename to packages/server/__snapshots__/5_subdomain_spec.js diff --git a/packages/server/__snapshots__/5_task_not_registered_spec.coffee.js b/packages/server/__snapshots__/5_task_not_registered_spec.js similarity index 100% rename from packages/server/__snapshots__/5_task_not_registered_spec.coffee.js rename to packages/server/__snapshots__/5_task_not_registered_spec.js diff --git a/packages/server/__snapshots__/6_task_spec.coffee.js b/packages/server/__snapshots__/6_task_spec.js similarity index 100% rename from packages/server/__snapshots__/6_task_spec.coffee.js rename to packages/server/__snapshots__/6_task_spec.js diff --git a/packages/server/__snapshots__/6_uncaught_spec_errors_spec.coffee.js b/packages/server/__snapshots__/6_uncaught_spec_errors_spec.js similarity index 100% rename from packages/server/__snapshots__/6_uncaught_spec_errors_spec.coffee.js rename to packages/server/__snapshots__/6_uncaught_spec_errors_spec.js diff --git a/packages/server/__snapshots__/6_uncaught_support_file_spec.coffee.js b/packages/server/__snapshots__/6_uncaught_support_file_spec.js similarity index 100% rename from packages/server/__snapshots__/6_uncaught_support_file_spec.coffee.js rename to packages/server/__snapshots__/6_uncaught_support_file_spec.js diff --git a/packages/server/__snapshots__/6_viewport_spec.coffee.js b/packages/server/__snapshots__/6_viewport_spec.js similarity index 100% rename from packages/server/__snapshots__/6_viewport_spec.coffee.js rename to packages/server/__snapshots__/6_viewport_spec.js diff --git a/packages/server/__snapshots__/6_visit_spec.coffee.js b/packages/server/__snapshots__/6_visit_spec.js similarity index 100% rename from packages/server/__snapshots__/6_visit_spec.coffee.js rename to packages/server/__snapshots__/6_visit_spec.js diff --git a/packages/server/__snapshots__/6_web_security_spec.coffee.js b/packages/server/__snapshots__/6_web_security_spec.js similarity index 100% rename from packages/server/__snapshots__/6_web_security_spec.coffee.js rename to packages/server/__snapshots__/6_web_security_spec.js diff --git a/packages/server/__snapshots__/7_record_spec.coffee.js b/packages/server/__snapshots__/7_record_spec.js similarity index 100% rename from packages/server/__snapshots__/7_record_spec.coffee.js rename to packages/server/__snapshots__/7_record_spec.js diff --git a/packages/server/__snapshots__/8_component_tests_spec.coffee.js b/packages/server/__snapshots__/8_component_tests_spec.js similarity index 100% rename from packages/server/__snapshots__/8_component_tests_spec.coffee.js rename to packages/server/__snapshots__/8_component_tests_spec.js diff --git a/packages/server/__snapshots__/8_network_error_handling_spec.coffee.js b/packages/server/__snapshots__/8_network_error_handling_spec.js similarity index 100% rename from packages/server/__snapshots__/8_network_error_handling_spec.coffee.js rename to packages/server/__snapshots__/8_network_error_handling_spec.js diff --git a/packages/server/__snapshots__/8_reporters_spec.coffee.js b/packages/server/__snapshots__/8_reporters_spec.js similarity index 100% rename from packages/server/__snapshots__/8_reporters_spec.coffee.js rename to packages/server/__snapshots__/8_reporters_spec.js diff --git a/packages/server/__snapshots__/args_spec.coffee.js b/packages/server/__snapshots__/args_spec.js similarity index 100% rename from packages/server/__snapshots__/args_spec.coffee.js rename to packages/server/__snapshots__/args_spec.js diff --git a/packages/server/__snapshots__/browsers_spec.coffee.js b/packages/server/__snapshots__/browsers_spec.js similarity index 100% rename from packages/server/__snapshots__/browsers_spec.coffee.js rename to packages/server/__snapshots__/browsers_spec.js diff --git a/packages/server/__snapshots__/errors_spec.coffee.js b/packages/server/__snapshots__/errors_spec.js similarity index 100% rename from packages/server/__snapshots__/errors_spec.coffee.js rename to packages/server/__snapshots__/errors_spec.js diff --git a/packages/server/__snapshots__/reporter_spec.coffee.js b/packages/server/__snapshots__/reporter_spec.js similarity index 100% rename from packages/server/__snapshots__/reporter_spec.coffee.js rename to packages/server/__snapshots__/reporter_spec.js diff --git a/packages/server/__snapshots__/run_plugins_spec.coffee.js b/packages/server/__snapshots__/run_plugins_spec.js similarity index 100% rename from packages/server/__snapshots__/run_plugins_spec.coffee.js rename to packages/server/__snapshots__/run_plugins_spec.js diff --git a/packages/server/__snapshots__/snapshot_spec.coffee.js b/packages/server/__snapshots__/snapshot_spec.js similarity index 100% rename from packages/server/__snapshots__/snapshot_spec.coffee.js rename to packages/server/__snapshots__/snapshot_spec.js diff --git a/packages/server/__snapshots__/terminal_spec.coffee.js b/packages/server/__snapshots__/terminal_spec.js similarity index 100% rename from packages/server/__snapshots__/terminal_spec.coffee.js rename to packages/server/__snapshots__/terminal_spec.js diff --git a/packages/server/__snapshots__/validation_spec.coffee.js b/packages/server/__snapshots__/validation_spec.js similarity index 100% rename from packages/server/__snapshots__/validation_spec.coffee.js rename to packages/server/__snapshots__/validation_spec.js diff --git a/packages/server/test/.eslintrc.json b/packages/server/test/.eslintrc.json index f8d37d4d41..42c1beed27 100644 --- a/packages/server/test/.eslintrc.json +++ b/packages/server/test/.eslintrc.json @@ -10,5 +10,8 @@ }, "extends": [ "plugin:@cypress/dev/tests" - ] + ], + "rules": { + "no-console": "off" + } } diff --git a/packages/server/test/e2e/1_async_timeouts_spec.js b/packages/server/test/e2e/1_async_timeouts_spec.js index dd0ebc47f7..7d435c6d61 100644 --- a/packages/server/test/e2e/1_async_timeouts_spec.js +++ b/packages/server/test/e2e/1_async_timeouts_spec.js @@ -1,16 +1,9 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e async timeouts', () => { e2e.setup() - return e2e.it('failing1', { + e2e.it('failing1', { spec: 'async_timeouts_spec.coffee', snapshot: true, expectedExitCode: 2, diff --git a/packages/server/test/e2e/1_base_url_spec.js b/packages/server/test/e2e/1_base_url_spec.js index ef11d865f8..0ba490f388 100644 --- a/packages/server/test/e2e/1_base_url_spec.js +++ b/packages/server/test/e2e/1_base_url_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = (app) => { @@ -21,7 +14,7 @@ describe('e2e baseUrl', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'base_url_spec.coffee', snapshot: true, }) @@ -38,7 +31,7 @@ describe('e2e baseUrl', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'base_url_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/1_blacklist_hosts_spec.js b/packages/server/test/e2e/1_blacklist_hosts_spec.js index 701f7691b4..ae38f96f5f 100644 --- a/packages/server/test/e2e/1_blacklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blacklist_hosts_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = function (app) { diff --git a/packages/server/test/e2e/1_browserify_babel_es201_spec.js b/packages/server/test/e2e/1_browserify_babel_es201_spec.js index ff6f79a48f..02d963be93 100644 --- a/packages/server/test/e2e/1_browserify_babel_es201_spec.js +++ b/packages/server/test/e2e/1_browserify_babel_es201_spec.js @@ -1,17 +1,4 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default -const Fixtures = require('../support/helpers/fixtures') - -const e2ePath = Fixtures.projectPath('e2e') describe('e2e browserify, babel, es2015', () => { e2e.setup() diff --git a/packages/server/test/e2e/1_busted_support_file_spec.js b/packages/server/test/e2e/1_busted_support_file_spec.js index 64f6ad6ef7..039a0a1fe2 100644 --- a/packages/server/test/e2e/1_busted_support_file_spec.js +++ b/packages/server/test/e2e/1_busted_support_file_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default diff --git a/packages/server/test/e2e/1_cache_spec.js b/packages/server/test/e2e/1_cache_spec.js index c9ed6f58e9..7fdd07692c 100644 --- a/packages/server/test/e2e/1_cache_spec.js +++ b/packages/server/test/e2e/1_cache_spec.js @@ -1,17 +1,5 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const fs = require('fs') const path = require('path') -const express = require('express') const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default @@ -74,9 +62,9 @@ describe('e2e cache', () => { return e2e.exec(this, { spec: 'cache_clearing_spec.coffee', }) - .then(() => // and after the cache is cleaned before - // opening the browser, it'll make a new request - { + .then(() => { + // and after the cache is cleaned before + // opening the browser, it'll make a new request expect(requestsForCache).to.eq(2) }) }) diff --git a/packages/server/test/e2e/1_caught_uncaught_hook_errors_spec.js b/packages/server/test/e2e/1_caught_uncaught_hook_errors_spec.js index d3857f354b..c629420088 100644 --- a/packages/server/test/e2e/1_caught_uncaught_hook_errors_spec.js +++ b/packages/server/test/e2e/1_caught_uncaught_hook_errors_spec.js @@ -1,18 +1,5 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default -const e2ePath = Fixtures.projectPath('e2e') - describe('e2e caught and uncaught hooks errors', () => { e2e.setup({ servers: { diff --git a/packages/server/test/e2e/1_commands_outside_of_test_spec.js b/packages/server/test/e2e/1_commands_outside_of_test_spec.js index 9086014a5d..dc795861be 100644 --- a/packages/server/test/e2e/1_commands_outside_of_test_spec.js +++ b/packages/server/test/e2e/1_commands_outside_of_test_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e commands outside of test', () => { @@ -22,7 +15,7 @@ describe('e2e commands outside of test', () => { expectedExitCode: 1, }) - return e2e.it('passes on passing assertions', { + e2e.it('passes on passing assertions', { spec: 'assertions_passing_outside_of_test_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/1_interception_spec.js b/packages/server/test/e2e/1_interception_spec.js index 4eec64b296..dd63e3f236 100644 --- a/packages/server/test/e2e/1_interception_spec.js +++ b/packages/server/test/e2e/1_interception_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - brace-style, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const compression = require('compression') const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') @@ -68,8 +58,8 @@ describe('e2e interception spec', () => { }, ] }) - context('character encodings', () => // https://github.com/cypress-io/cypress/issues/1543 - { + context('character encodings', () => { + // @see https://github.com/cypress-io/cypress/issues/1543 it('does not mangle non-UTF-8 text', function () { return e2e.exec(this, { spec: 'character_encoding_spec.js', diff --git a/packages/server/test/e2e/1_system_node_spec.js b/packages/server/test/e2e/1_system_node_spec.js index 76eede4c70..3a0486c354 100644 --- a/packages/server/test/e2e/1_system_node_spec.js +++ b/packages/server/test/e2e/1_system_node_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const execa = require('execa') const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/e2e/2_cookies_spec.js b/packages/server/test/e2e/2_cookies_spec.js index ce00f1a1c8..2b9d062630 100644 --- a/packages/server/test/e2e/2_cookies_spec.js +++ b/packages/server/test/e2e/2_cookies_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - brace-style, - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const moment = require('moment') const parser = require('cookie-parser') const e2e = require('../support/helpers/e2e').default @@ -135,8 +124,8 @@ const onServer = function (app) { return res.type('html').end() }) - return app.get('/invalidControlCharCookie', (req, res) => // `http` lib throws an error if we use .setHeader to set this - { + return app.get('/invalidControlCharCookie', (req, res) => { + // `http` lib throws an error if we use .setHeader to set this return res.connection.end(`\ HTTP/1.1 200 OK Content-Type: text/html @@ -203,7 +192,7 @@ describe('e2e cookies', () => { // once browsers are shipping with the options in FORCED_SAMESITE_ENV as default, // we can remove this extra test case - return e2e.it('with forced SameSite strictness', { + e2e.it('with forced SameSite strictness', { config: { experimentalGetCookiesSameSite: true, baseUrl, @@ -257,7 +246,7 @@ describe('e2e cookies', () => { https, ], ) => { - return e2e.it(`passes with baseurl: ${baseUrl}`, { + e2e.it(`passes with baseurl: ${baseUrl}`, { config: { experimentalGetCookiesSameSite: true, baseUrl, @@ -281,7 +270,7 @@ describe('e2e cookies', () => { }) }) - return e2e.it('passes with no baseurl', { + e2e.it('passes with no baseurl', { config: { env: { httpUrl, diff --git a/packages/server/test/e2e/2_go_spec.js b/packages/server/test/e2e/2_go_spec.js index b42a4a71cf..442a4f8b04 100644 --- a/packages/server/test/e2e/2_go_spec.js +++ b/packages/server/test/e2e/2_go_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = function (app) { @@ -28,7 +21,7 @@ describe('e2e go', () => { // this tests that history changes work as intended // there have been regressions in electron which would // otherwise cause these tests to fail - return e2e.it('passes', { + e2e.it('passes', { spec: 'go_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/2_iframe_spec.js b/packages/server/test/e2e/2_iframe_spec.js index 3433b6ddd3..a1728b8269 100644 --- a/packages/server/test/e2e/2_iframe_spec.js +++ b/packages/server/test/e2e/2_iframe_spec.js @@ -1,15 +1,3 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const fs = require('fs') const path = require('path') const bodyParser = require('body-parser') const Fixtures = require('../support/helpers/fixtures') @@ -64,8 +52,7 @@ outer contents return res.send('simple') }) - app.get('/iframe', (req, res) => // send the iframe contents - { + app.get('/iframe', (req, res) => { return res.sendFile(path.join(e2ePath, 'static', 'iframe', 'index.html')) }) @@ -89,7 +76,7 @@ describe('e2e iframes', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'iframe_spec.coffee', snapshot: true, config: { diff --git a/packages/server/test/e2e/2_images_spec.js b/packages/server/test/e2e/2_images_spec.js index ca0cefb9d6..453fd34df5 100644 --- a/packages/server/test/e2e/2_images_spec.js +++ b/packages/server/test/e2e/2_images_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e images', () => { @@ -17,8 +10,7 @@ describe('e2e images', () => { // this tests that images are correctly proxied and that we are not // accidentally modifying their bytes in the stream - - return e2e.it('passes', { + e2e.it('passes', { spec: 'images_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/3_config_spec.js b/packages/server/test/e2e/3_config_spec.js index ea0a051071..a865d27687 100644 --- a/packages/server/test/e2e/3_config_spec.js +++ b/packages/server/test/e2e/3_config_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/e2e/3_issue_149_spec.js b/packages/server/test/e2e/3_issue_149_spec.js index 6f7e71b293..f106458f79 100644 --- a/packages/server/test/e2e/3_issue_149_spec.js +++ b/packages/server/test/e2e/3_issue_149_spec.js @@ -1,34 +1,20 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const fs = require('../../lib/util/fs') const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default -const e2ePath = Fixtures.projectPath('e2e') - describe('e2e issue 149', () => { e2e.setup() // https://github.com/cypress-io/cypress/issues/149 - it('failing', function () { return e2e.exec(this, { spec: 'issue_149_spec.coffee', snapshot: true, expectedExitCode: 1, }) - .then(() => // the other test should have still run which should - // have created this file - { + .then(() => { + // the other test should have still run which should + // have created this file return fs.readFileAsync(Fixtures.projectPath('e2e/foo.js'), 'utf8') }).then((str) => { expect(str).to.eq('bar') diff --git a/packages/server/test/e2e/3_issue_1669_spec.js b/packages/server/test/e2e/3_issue_1669_spec.js index fe826c8196..340f99b89d 100644 --- a/packages/server/test/e2e/3_issue_1669_spec.js +++ b/packages/server/test/e2e/3_issue_1669_spec.js @@ -1,21 +1,9 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default -const Fixtures = require('../support/helpers/fixtures') describe('e2e issue 1669', () => { e2e.setup() // https://github.com/cypress-io/cypress/issues/1669 - it('passes', function () { return e2e.exec(this, { spec: 'issue_1669_spec.js', diff --git a/packages/server/test/e2e/3_issue_173_spec.js b/packages/server/test/e2e/3_issue_173_spec.js index 6e50bb90bf..d73090d33a 100644 --- a/packages/server/test/e2e/3_issue_173_spec.js +++ b/packages/server/test/e2e/3_issue_173_spec.js @@ -1,18 +1,10 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e issue 173', () => { e2e.setup() // https://github.com/cypress-io/cypress/issues/173 - - return e2e.it('failing', { + e2e.it('failing', { spec: 'issue_173_spec.coffee', snapshot: true, expectedExitCode: 1, diff --git a/packages/server/test/e2e/3_issue_2891_spec.js b/packages/server/test/e2e/3_issue_2891_spec.js index 9beeb342aa..d9679e2aed 100644 --- a/packages/server/test/e2e/3_issue_2891_spec.js +++ b/packages/server/test/e2e/3_issue_2891_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') @@ -12,7 +5,6 @@ describe('e2e issue 2891', () => { e2e.setup() // https://github.com/cypress-io/cypress/issues/2891 - it('passes', function () { return e2e.exec(this, { project: Fixtures.projectPath('default-layout'), diff --git a/packages/server/test/e2e/3_issue_674_spec.js b/packages/server/test/e2e/3_issue_674_spec.js index 3b48c460c3..80cd129e52 100644 --- a/packages/server/test/e2e/3_issue_674_spec.js +++ b/packages/server/test/e2e/3_issue_674_spec.js @@ -1,18 +1,10 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e issue 674', () => { e2e.setup() // https://github.com/cypress-io/cypress/issues/674 - - return e2e.it('fails', { + e2e.it('fails', { spec: 'issue_674_spec.coffee', snapshot: true, expectedExitCode: 1, diff --git a/packages/server/test/e2e/3_js_error_handling_spec.js b/packages/server/test/e2e/3_js_error_handling_spec.js index 1f4fbe2dfa..6cbbb6b9a3 100644 --- a/packages/server/test/e2e/3_js_error_handling_spec.js +++ b/packages/server/test/e2e/3_js_error_handling_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const fs = require('fs') const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default @@ -52,7 +45,7 @@ describe('e2e js error handling', () => { }], }) - return e2e.it('fails', { + e2e.it('fails', { spec: 'js_error_handling_failing_spec.coffee', snapshot: true, expectedExitCode: 5, diff --git a/packages/server/test/e2e/3_new_project_spec.js b/packages/server/test/e2e/3_new_project_spec.js index 43feca1ffb..b47930ed83 100644 --- a/packages/server/test/e2e/3_new_project_spec.js +++ b/packages/server/test/e2e/3_new_project_spec.js @@ -1,15 +1,8 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const path = require('path') const Promise = require('bluebird') -let fs = require('../../lib/util/fs') const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default +let fs = require('../../lib/util/fs') fs = Promise.promisifyAll(fs) diff --git a/packages/server/test/e2e/3_only_spec.js b/packages/server/test/e2e/3_only_spec.js index d77abd28d1..79a2c7ec5f 100644 --- a/packages/server/test/e2e/3_only_spec.js +++ b/packages/server/test/e2e/3_only_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e only spec', () => { diff --git a/packages/server/test/e2e/3_page_loading_spec.js b/packages/server/test/e2e/3_page_loading_spec.js index d40fcc2b5d..b3ebfa265f 100644 --- a/packages/server/test/e2e/3_page_loading_spec.js +++ b/packages/server/test/e2e/3_page_loading_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const bodyParser = require('body-parser') const e2e = require('../support/helpers/e2e').default @@ -84,7 +77,7 @@ describe('e2e page_loading', () => { // additionally this creates an edge case where after __cypress.initial is // set we send an XHR which should not inject because its requested for JSON // but that another XHR which is requested for html should inject - return e2e.it('passes', { + e2e.it('passes', { spec: 'page_loading_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/3_user_agent_spec.js b/packages/server/test/e2e/3_user_agent_spec.js index 05070cff3b..55c768a566 100644 --- a/packages/server/test/e2e/3_user_agent_spec.js +++ b/packages/server/test/e2e/3_user_agent_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = function (app) { @@ -33,7 +26,7 @@ describe('e2e user agent', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'user_agent_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/4_browser_path_spec.js b/packages/server/test/e2e/4_browser_path_spec.js index 948ca9306d..accb274c10 100644 --- a/packages/server/test/e2e/4_browser_path_spec.js +++ b/packages/server/test/e2e/4_browser_path_spec.js @@ -1,14 +1,5 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const path = require('path') -const { - exec, -} = require('child_process') +const { exec } = require('child_process') const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/e2e/4_controllers_spec.js b/packages/server/test/e2e/4_controllers_spec.js index 101d8f0a5b..9d1c83ff4f 100644 --- a/packages/server/test/e2e/4_controllers_spec.js +++ b/packages/server/test/e2e/4_controllers_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const fs = require('fs-extra') const path = require('path') diff --git a/packages/server/test/e2e/4_domain_spec.js b/packages/server/test/e2e/4_domain_spec.js index 534af03c6f..5a79c0ca6b 100644 --- a/packages/server/test/e2e/4_domain_spec.js +++ b/packages/server/test/e2e/4_domain_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const hosts = { @@ -20,7 +13,7 @@ describe('e2e domain', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'domain*', snapshot: true, video: false, diff --git a/packages/server/test/e2e/4_form_submissions_spec.js b/packages/server/test/e2e/4_form_submissions_spec.js index 6fec565360..a3e6cec5db 100644 --- a/packages/server/test/e2e/4_form_submissions_spec.js +++ b/packages/server/test/e2e/4_form_submissions_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - brace-style, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const rp = require('@cypress/request-promise') const path = require('path') const Promise = require('bluebird') @@ -111,7 +101,7 @@ describe('e2e forms', () => { snapshot: true, }) - return e2e.it('failing', { + e2e.it('failing', { spec: 'form_submission_failing_spec.coffee', snapshot: true, expectedExitCode: 1, @@ -142,12 +132,12 @@ describe('e2e forms', () => { ], }) - before(() => // go out and fetch this image if we don't already have it - { + before(() => { + // go out and fetch this image if we don't already have it return fs .readFileAsync(pathToLargeImage) - .catch({ code: 'ENOENT' }, () => // 16MB image, too big to include with git repo - { + .catch({ code: 'ENOENT' }, () => { + // 16MB image, too big to include with git repo return rp('https://test-page-speed.cypress.io/files/huge-image.jpg') .then((resp) => { return fs.outputFileAsync(pathToLargeImage, resp) @@ -163,7 +153,7 @@ describe('e2e forms', () => { snapshot: true, }) - return e2e.it('passes with http on localhost', { + e2e.it('passes with http on localhost', { config: { baseUrl: `http://localhost:${HTTP_PORT}`, }, diff --git a/packages/server/test/e2e/4_promises_spec.js b/packages/server/test/e2e/4_promises_spec.js index 0557639178..c63ae67a14 100644 --- a/packages/server/test/e2e/4_promises_spec.js +++ b/packages/server/test/e2e/4_promises_spec.js @@ -1,16 +1,9 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e promises', () => { e2e.setup() - return e2e.it('failing1', { + e2e.it('failing1', { spec: 'promises_spec.coffee', snapshot: true, expectedExitCode: 2, diff --git a/packages/server/test/e2e/4_request_spec.js b/packages/server/test/e2e/4_request_spec.js index 0aa2c2f02e..fa33ab6e61 100644 --- a/packages/server/test/e2e/4_request_spec.js +++ b/packages/server/test/e2e/4_request_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - brace-style, - default-case, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const bodyParser = require('body-parser') const cookieParser = require('cookie-parser') const e2e = require('../support/helpers/e2e').default @@ -18,8 +7,7 @@ let counts = null const urlencodedParser = bodyParser.urlencoded({ extended: false }) const jsonParser = bodyParser.json() -const sendBackBody = (req, res) => // send back to the body -{ +const sendBackBody = (req, res) => { return res.json(req.body) } @@ -135,6 +123,7 @@ const onServer = function (app) { }) .cookie('2293-session', true) .send({}) + default: } }) } diff --git a/packages/server/test/e2e/4_return_value_spec.js b/packages/server/test/e2e/4_return_value_spec.js index 3d56850169..02ece1ff5c 100644 --- a/packages/server/test/e2e/4_return_value_spec.js +++ b/packages/server/test/e2e/4_return_value_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e return value', () => { diff --git a/packages/server/test/e2e/4_screenshot_element_capture_spec.js b/packages/server/test/e2e/4_screenshot_element_capture_spec.js index 88e4e29485..e0d9c5b53d 100644 --- a/packages/server/test/e2e/4_screenshot_element_capture_spec.js +++ b/packages/server/test/e2e/4_screenshot_element_capture_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = (app) => { @@ -26,7 +19,7 @@ describe('e2e screenshot element capture', () => { // this tests that consistent screenshots are taken for element captures, // that the runner UI is hidden and that the page is scrolled properly - return e2e.it('passes', { + e2e.it('passes', { spec: 'screenshot_element_capture_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/4_screenshot_fullpage_capture_spec.js b/packages/server/test/e2e/4_screenshot_fullpage_capture_spec.js index c8ac36de87..79c61d6199 100644 --- a/packages/server/test/e2e/4_screenshot_fullpage_capture_spec.js +++ b/packages/server/test/e2e/4_screenshot_fullpage_capture_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = (app) => { @@ -28,7 +21,7 @@ describe('e2e screenshot fullPage capture', () => { // this tests that consistent screenshots are taken for fullPage captures, // that the runner UI is hidden and that the page is scrolled properly - return e2e.it('passes', { + e2e.it('passes', { spec: 'screenshot_fullpage_capture_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/4_screenshot_nested_file_spec.js b/packages/server/test/e2e/4_screenshot_nested_file_spec.js index 707289dbdc..e63e60428b 100644 --- a/packages/server/test/e2e/4_screenshot_nested_file_spec.js +++ b/packages/server/test/e2e/4_screenshot_nested_file_spec.js @@ -1,16 +1,9 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e screenshot in nested spec', () => { e2e.setup() - return e2e.it('passes', { + e2e.it('passes', { spec: 'nested-1/nested-2/screenshot_nested_file_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/4_websockets_spec.js b/packages/server/test/e2e/4_websockets_spec.js index 3937c8d4fe..2b788a4d6e 100644 --- a/packages/server/test/e2e/4_websockets_spec.js +++ b/packages/server/test/e2e/4_websockets_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const ws = require('ws') const e2e = require('../support/helpers/e2e').default @@ -43,7 +36,7 @@ describe('e2e websockets', () => { }) // https://github.com/cypress-io/cypress/issues/556 - return e2e.it('passes', { + e2e.it('passes', { spec: 'websockets_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/4_window_open_spec.js b/packages/server/test/e2e/4_window_open_spec.js index 98ac1d134c..937f96cca8 100644 --- a/packages/server/test/e2e/4_window_open_spec.js +++ b/packages/server/test/e2e/4_window_open_spec.js @@ -1,22 +1,10 @@ -/* eslint-disable - @cypress/dev/skip-comment, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e window.open', () => { e2e.setup() - // skipping this for now due to - // snap-shot-it monkey patching - // causing test failures - return it.skip('passes', function () { + // NOTE: skipping this for now due to snap-shot-it monkey patching causing test failures + it.skip('passes', function () { return e2e.exec(this, { spec: 'window_open_spec.coffee', snapshot: true, diff --git a/packages/server/test/e2e/4_xhr_spec.js b/packages/server/test/e2e/4_xhr_spec.js index 582fb67bb3..554f1c1116 100644 --- a/packages/server/test/e2e/4_xhr_spec.js +++ b/packages/server/test/e2e/4_xhr_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - brace-style, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const bodyParser = require('body-parser') const e2e = require('../support/helpers/e2e').default @@ -18,9 +8,7 @@ const onServer = function (app) { return res.send('hi there') }) - app.post('/login', (req, res) => // respond with JSON with exactly what the - // request body was and all of the request headers - { + app.post('/login', (req, res) => { return res.json({ body: req.body, headers: req.headers, @@ -45,7 +33,7 @@ describe('e2e xhr', () => { snapshot: true, }) - return e2e.it('passes through CLI', { + e2e.it('passes through CLI', { spec: 'xhr_spec.coffee', snapshot: true, useCli: true, diff --git a/packages/server/test/e2e/5_screenshot_viewport_capture_spec.js b/packages/server/test/e2e/5_screenshot_viewport_capture_spec.js index 9e0cd7c74f..afc22c32bf 100644 --- a/packages/server/test/e2e/5_screenshot_viewport_capture_spec.js +++ b/packages/server/test/e2e/5_screenshot_viewport_capture_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const onServer = (app) => { @@ -24,7 +17,7 @@ describe('e2e screenshot viewport capture', () => { // this tests that consistent screenshots are taken for app // captures (namely that the runner UI is hidden) - return e2e.it('passes', { + e2e.it('passes', { spec: 'screenshot_viewport_capture_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/5_screenshots_spec.js b/packages/server/test/e2e/5_screenshots_spec.js index f2d0f1a3bd..a5934ec1b6 100644 --- a/packages/server/test/e2e/5_screenshots_spec.js +++ b/packages/server/test/e2e/5_screenshots_spec.js @@ -1,20 +1,14 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const path = require('path') const Promise = require('bluebird') -let sizeOf = require('image-size') -let fs = require('../../lib/util/fs') const Fixtures = require('../support/helpers/fixtures') const e2e = require('../support/helpers/e2e').default +let sizeOf = require('image-size') +let fs = require('../../lib/util/fs') fs = Promise.promisifyAll(fs) sizeOf = Promise.promisify(sizeOf) + const e2ePath = Fixtures.projectPath('e2e') const onServer = function (app) { @@ -67,7 +61,7 @@ describe('e2e screenshots', () => { // this tests that screenshots can be manually generated // and are also generated automatically on failure with // the test title as the file name - return e2e.it('passes', { + e2e.it('passes', { spec: 'screenshots_spec.js', expectedExitCode: 4, snapshot: true, diff --git a/packages/server/test/e2e/5_server_sent_events_spec.js b/packages/server/test/e2e/5_server_sent_events_spec.js index ee25970c9d..a58cf83733 100644 --- a/packages/server/test/e2e/5_server_sent_events_spec.js +++ b/packages/server/test/e2e/5_server_sent_events_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const SseStream = require('ssestream') const e2e = require('../support/helpers/e2e').default @@ -73,7 +66,7 @@ describe('e2e server sent events', () => { }) // https://github.com/cypress-io/cypress/issues/1440 - return e2e.it('passes', { + e2e.it('passes', { spec: 'server_sent_events_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/5_spec_isolation_spec.js b/packages/server/test/e2e/5_spec_isolation_spec.js index 053611b461..9756d61029 100644 --- a/packages/server/test/e2e/5_spec_isolation_spec.js +++ b/packages/server/test/e2e/5_spec_isolation_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - brace-style, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const path = require('path') const moment = require('moment') @@ -122,8 +112,7 @@ const expectRunsToHaveCorrectStats = (runs = []) => { 1234, ) - const addFnAndAfterFn = (obj) => // add these two together - { + const addFnAndAfterFn = (obj) => { return obj.fnDuration + obj.afterFnDuration } @@ -196,16 +185,16 @@ const expectRunsToHaveCorrectStats = (runs = []) => { describe('e2e spec_isolation', () => { e2e.setup() - return e2e.it('fails', { + e2e.it('fails', { spec: specs, outputPath, snapshot: false, expectedExitCode: 5, onRun (exec) { return exec() - .then(() => // now what we want to do is read in the outputPath - // and snapshot it so its what we expect after normalizing it - { + .then(() => { + // now what we want to do is read in the outputPath + // and snapshot it so its what we expect after normalizing it return fs.readJsonAsync(outputPath) .then((json) => { // ensure that config has been set diff --git a/packages/server/test/e2e/5_specs_spec.js b/packages/server/test/e2e/5_specs_spec.js index c6613e44c5..38438214b8 100644 --- a/packages/server/test/e2e/5_specs_spec.js +++ b/packages/server/test/e2e/5_specs_spec.js @@ -1,17 +1,4 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default -const Fixtures = require('../support/helpers/fixtures') - -const e2ePath = Fixtures.projectPath('e2e') describe('e2e specs', () => { e2e.setup() diff --git a/packages/server/test/e2e/5_stdout_spec.js b/packages/server/test/e2e/5_stdout_spec.js index 10457e3582..412761cde2 100644 --- a/packages/server/test/e2e/5_stdout_spec.js +++ b/packages/server/test/e2e/5_stdout_spec.js @@ -1,15 +1,4 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default -const Fixtures = require('../support/helpers/fixtures') describe('e2e stdout', () => { e2e.setup() @@ -47,7 +36,7 @@ describe('e2e stdout', () => { }) }) - return e2e.it('displays assertion errors', { + e2e.it('displays assertion errors', { spec: 'stdout_assertion_errors_spec.js', snapshot: true, expectedExitCode: 4, diff --git a/packages/server/test/e2e/5_subdomain_spec.js b/packages/server/test/e2e/5_subdomain_spec.js index 6e53fdf47a..ebcf82fb21 100644 --- a/packages/server/test/e2e/5_subdomain_spec.js +++ b/packages/server/test/e2e/5_subdomain_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const cors = require('cors') const parser = require('cookie-parser') const session = require('express-session') @@ -128,7 +118,7 @@ describe('e2e subdomain', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'subdomain_spec.coffee', snapshot: true, config: { diff --git a/packages/server/test/e2e/5_task_not_registered_spec.js b/packages/server/test/e2e/5_task_not_registered_spec.js index 62217fa2ce..1c639121a2 100644 --- a/packages/server/test/e2e/5_task_not_registered_spec.js +++ b/packages/server/test/e2e/5_task_not_registered_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/e2e/6_task_spec.js b/packages/server/test/e2e/6_task_spec.js index 623351fa4b..c5b9bce329 100644 --- a/packages/server/test/e2e/6_task_spec.js +++ b/packages/server/test/e2e/6_task_spec.js @@ -1,12 +1,4 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default - const Fixtures = require('../support/helpers/fixtures') describe('e2e task', () => { diff --git a/packages/server/test/e2e/6_uncaught_spec_errors_spec.js b/packages/server/test/e2e/6_uncaught_spec_errors_spec.js index 5f1589643e..43e86b9d11 100644 --- a/packages/server/test/e2e/6_uncaught_spec_errors_spec.js +++ b/packages/server/test/e2e/6_uncaught_spec_errors_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e uncaught errors', () => { @@ -34,7 +27,7 @@ describe('e2e uncaught errors', () => { expectedExitCode: 1, }) - return e2e.it('failing5', { + e2e.it('failing5', { spec: 'caught_async_sync_test_spec.coffee', snapshot: true, expectedExitCode: 4, diff --git a/packages/server/test/e2e/6_uncaught_support_file_spec.js b/packages/server/test/e2e/6_uncaught_support_file_spec.js index 5ceeeebb74..d7e496f654 100644 --- a/packages/server/test/e2e/6_uncaught_support_file_spec.js +++ b/packages/server/test/e2e/6_uncaught_support_file_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/e2e/6_video_compression_spec.js b/packages/server/test/e2e/6_video_compression_spec.js index de1e081ee0..1899db1217 100644 --- a/packages/server/test/e2e/6_video_compression_spec.js +++ b/packages/server/test/e2e/6_video_compression_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const path = require('path') const humanInterval = require('human-interval') const e2e = require('../support/helpers/e2e').default const glob = require('../../lib/util/glob') @@ -26,7 +15,7 @@ describe('e2e video compression', () => { true, false, ].forEach((headed) => { - return e2e.it(`passes (head${headed ? 'ed' : 'less'})`, { + e2e.it(`passes (head${headed ? 'ed' : 'less'})`, { spec: 'video_compression_spec.coffee', snapshot: false, headed, diff --git a/packages/server/test/e2e/6_viewport_spec.js b/packages/server/test/e2e/6_viewport_spec.js index 13495d30d8..32cf111520 100644 --- a/packages/server/test/e2e/6_viewport_spec.js +++ b/packages/server/test/e2e/6_viewport_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default describe('e2e viewport', () => { @@ -15,7 +8,7 @@ describe('e2e viewport', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'viewport_spec.coffee', snapshot: true, }) diff --git a/packages/server/test/e2e/6_visit_spec.js b/packages/server/test/e2e/6_visit_spec.js index c210067457..a97de207c5 100644 --- a/packages/server/test/e2e/6_visit_spec.js +++ b/packages/server/test/e2e/6_visit_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - brace-style, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const Bluebird = require('bluebird') const cert = require('@packages/https-proxy/test/helpers/certs') @@ -87,8 +76,8 @@ const onServer = function (app) { , ms) }) - app.get('/response_never_finishes', (req, res) => // dont ever end this response - { + app.get('/response_never_finishes', (req, res) => { + // dont ever end this response return res.type('html').write('foo\n') }) @@ -178,7 +167,7 @@ describe('e2e visit', () => { expectedExitCode: 1, }) - return e2e.it('calls onBeforeLoad when overwriting cy.visit', { + e2e.it('calls onBeforeLoad when overwriting cy.visit', { snapshot: true, spec: 'issue_2196_spec.coffee', }) @@ -196,7 +185,7 @@ describe('e2e visit', () => { }, }) - return e2e.it('fails when response never ends', { + e2e.it('fails when response never ends', { spec: 'visit_response_never_ends_failing_spec.js', snapshot: true, expectedExitCode: 3, @@ -215,7 +204,7 @@ describe('e2e visit', () => { }, }) - return e2e.it('fails when visit times out', { + e2e.it('fails when visit times out', { spec: 'visit_http_timeout_failing_spec.coffee', snapshot: true, expectedExitCode: 2, diff --git a/packages/server/test/e2e/6_web_security_spec.js b/packages/server/test/e2e/6_web_security_spec.js index 826f6b37d7..2261dba6bf 100644 --- a/packages/server/test/e2e/6_web_security_spec.js +++ b/packages/server/test/e2e/6_web_security_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const str = require('underscore.string') const e2e = require('../support/helpers/e2e').default const onServer = function (app) { @@ -69,7 +58,7 @@ describe('e2e web security', () => { }, }) - return e2e.it('fails', { + e2e.it('fails', { spec: 'web_security_spec.coffee', snapshot: true, expectedExitCode: 3, @@ -94,7 +83,7 @@ describe('e2e web security', () => { }, }) - return e2e.it('passes', { + e2e.it('passes', { spec: 'web_security_spec.coffee', snapshot: true, browser: ['chrome', 'electron'], @@ -109,7 +98,7 @@ context('firefox', () => { }, }) - return e2e.it('displays warning when firefox and chromeWebSecurity:false', { + e2e.it('displays warning when firefox and chromeWebSecurity:false', { spec: 'simple_passing_spec.coffee', snapshot: true, browser: 'firefox', diff --git a/packages/server/test/e2e/7_record_spec.js b/packages/server/test/e2e/7_record_spec.js index fbd7caf1c1..51bd2bdebd 100644 --- a/packages/server/test/e2e/7_record_spec.js +++ b/packages/server/test/e2e/7_record_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - brace-style, - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const path = require('path') const Promise = require('bluebird') @@ -123,8 +112,8 @@ const assertResponseBodySchema = function (req, res, next) { const chunks = [] - res.write = (chunk) => // buffer the response, we'll really write it on end - { + res.write = (chunk) => { + // buffer the response, we'll really write it on end return chunks.push(chunk) } diff --git a/packages/server/test/e2e/8_component_tests_spec.js b/packages/server/test/e2e/8_component_tests_spec.js index a2b8a549d6..ea2951f40a 100644 --- a/packages/server/test/e2e/8_component_tests_spec.js +++ b/packages/server/test/e2e/8_component_tests_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const e2e = require('../support/helpers/e2e').default const Fixtures = require('../support/helpers/fixtures') const snapshot = require('snap-shot-it') diff --git a/packages/server/test/e2e/8_network_error_handling_spec.js b/packages/server/test/e2e/8_network_error_handling_spec.js index d2131d4265..d4f7c0d25f 100644 --- a/packages/server/test/e2e/8_network_error_handling_spec.js +++ b/packages/server/test/e2e/8_network_error_handling_spec.js @@ -1,33 +1,18 @@ -/* eslint-disable - no-console, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const express = require('express') const http = require('http') const https = require('https') const path = require('path') -const net = require('net') -const request = require('@cypress/request') -const stream = require('stream') const debug = require('debug')('cypress:server:network-error-handling-spec') const Promise = require('bluebird') const bodyParser = require('body-parser') const DebugProxy = require('@cypress/debugging-proxy') -let mitmProxy = require('http-mitm-proxy') const launcher = require('@packages/launcher') const chrome = require('../../lib/browsers/chrome') const e2e = require('../support/helpers/e2e').default const random = require('../../lib/util/random') const Fixtures = require('../support/helpers/fixtures') +let mitmProxy = require('http-mitm-proxy') const PORT = 13370 const PROXY_PORT = 13371 diff --git a/packages/server/test/e2e/8_reporters_spec.js b/packages/server/test/e2e/8_reporters_spec.js index ee3b55ccc1..c22481e800 100644 --- a/packages/server/test/e2e/8_reporters_spec.js +++ b/packages/server/test/e2e/8_reporters_spec.js @@ -1,16 +1,4 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const path = require('path') -const Promise = require('bluebird') -const cp = require('child_process') const fs = require('../../lib/util/fs') const glob = require('../../lib/util/glob') const e2e = require('../support/helpers/e2e').default diff --git a/packages/server/test/integration/cli_spec.js b/packages/server/test/integration/cli_spec.js index 7ca36dc882..94bc65f8ac 100644 --- a/packages/server/test/integration/cli_spec.js +++ b/packages/server/test/integration/cli_spec.js @@ -1,20 +1,8 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') const R = require('ramda') const cp = require('child_process') -const pr = require('../support/helpers/process') const pkg = require('../../package.json') const execa = require('execa') const semver = require('semver') @@ -23,10 +11,10 @@ const anyLineWithCaret = (str) => { return str[0] === '>' } -const clean = (str) => // remove blank lines and slice off any line -// starting with a caret because thats junk -// from npm logs -{ +const clean = (str) => { + // remove blank lines and slice off any line + // starting with a caret because thats junk + // from npm logs return _ .chain(str) .split('\n') diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index abbe1d2abb..627fd351ab 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -88,7 +88,7 @@ const previousCwd = process.cwd() const snapshotConsoleLogs = function (name) { const args = _ - .chain(console.log.args) // eslint-disable-line no-console + .chain(console.log.args) .map((innerArgs) => { return innerArgs.join(' ') }).join('\n') @@ -247,7 +247,6 @@ describe('lib/cypress', () => { return cypress.start(['--get-key', `--project=${this.todosPath}`]) }).then(() => { - // eslint-disable-next-line no-console expect(console.log).to.be.calledWith('new-key-123') this.expectExitWith(0) }) @@ -318,7 +317,6 @@ describe('lib/cypress', () => { return cypress.start(['--new-key', `--project=${this.todosPath}`]) }).then(() => { - // eslint-disable-next-line no-console expect(console.log).to.be.calledWith('new-key-123') this.expectExitWith(0) }) @@ -728,11 +726,8 @@ describe('lib/cypress', () => { return cypress.start([`--run-project=${this.todosPath}`, '--key=asdf']) .then(() => { expect(errors.warning).to.be.calledWith('PROJECT_ID_AND_KEY_BUT_MISSING_RECORD_OPTION', 'abc123') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('You also provided your Record Key, but you did not pass the --record flag.') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('cypress run --record') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('https://on.cypress.io/recording-project-runs') }) }) @@ -745,9 +740,7 @@ describe('lib/cypress', () => { return cypress.start([`--run-project=${this.todosPath}`]) .then(() => { expect(errors.warning).to.be.calledWith('CANNOT_REMOVE_OLD_BROWSER_PROFILES', err.stack) - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('Warning: We failed to remove old browser profiles from previous runs.') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch(err.message) }) }) @@ -756,7 +749,6 @@ describe('lib/cypress', () => { return cypress.start([`--run-project=${this.pristinePath}`, '--key=asdf']) .then(() => { expect(errors.warning).not.to.be.calledWith('PROJECT_ID_AND_KEY_BUT_MISSING_RECORD_OPTION', 'abc123') - // eslint-disable-next-line no-console expect(console.log).not.to.be.calledWithMatch('cypress run --key ') }) }) @@ -765,7 +757,6 @@ describe('lib/cypress', () => { return cypress.start([`--run-project=${this.todosPath}`, '--key=asdf', '--record=false']) .then(() => { expect(errors.warning).not.to.be.calledWith('PROJECT_ID_AND_KEY_BUT_MISSING_RECORD_OPTION', 'abc123') - // eslint-disable-next-line no-console expect(console.log).not.to.be.calledWithMatch('cypress run --key ') }) }) @@ -1380,9 +1371,7 @@ describe('lib/cypress', () => { ]) .then(() => { expect(errors.warning).to.be.calledWith('CYPRESS_CI_DEPRECATED') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('You are using the deprecated command:') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('cypress run --record --key ') expect(errors.warning).not.to.be.calledWith('PROJECT_ID_AND_KEY_BUT_MISSING_RECORD_OPTION') this.expectExitWith(3) @@ -1401,11 +1390,8 @@ describe('lib/cypress', () => { ]) .then(() => { expect(errors.warning).to.be.calledWith('CYPRESS_CI_DEPRECATED_ENV_VAR') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('You are using the deprecated command:') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('cypress ci') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('cypress run --record') this.expectExitWith(3) }) @@ -1718,7 +1704,6 @@ describe('lib/cypress', () => { context('--return-pkg', () => { beforeEach(() => { - // eslint-disable-next-line no-console console.log.restore() sinon.stub(console, 'log') @@ -1727,7 +1712,6 @@ describe('lib/cypress', () => { it('logs package.json and exits', function () { return cypress.start(['--return-pkg']) .then(() => { - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('{"name":"cypress"') this.expectExitWith(0) }) @@ -1736,7 +1720,6 @@ describe('lib/cypress', () => { context('--version', () => { beforeEach(() => { - // eslint-disable-next-line no-console console.log.restore() sinon.stub(console, 'log') @@ -1745,7 +1728,6 @@ describe('lib/cypress', () => { it('logs version and exits', function () { return cypress.start(['--version']) .then(() => { - // eslint-disable-next-line no-console expect(console.log).to.be.calledWith(pkg.version) this.expectExitWith(0) }) @@ -1754,7 +1736,6 @@ describe('lib/cypress', () => { context('--smoke-test', () => { beforeEach(() => { - // eslint-disable-next-line no-console console.log.restore() sinon.stub(console, 'log') @@ -1763,7 +1744,6 @@ describe('lib/cypress', () => { it('logs pong value and exits', function () { return cypress.start(['--smoke-test', '--ping=abc123']) .then(() => { - // eslint-disable-next-line no-console expect(console.log).to.be.calledWith('abc123') this.expectExitWith(0) }) @@ -1991,9 +1971,7 @@ describe('lib/cypress', () => { it('shows warning if Cypress has been started directly', () => { return cypress.start().then(() => { expect(errors.warning).to.be.calledWith('INVOKED_BINARY_OUTSIDE_NPM_MODULE') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('It looks like you are running the Cypress binary directly.') - // eslint-disable-next-line no-console expect(console.log).to.be.calledWithMatch('https://on.cypress.io/installing-cypress') }) }) diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index f051e51ab2..de88edfe63 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') @@ -35,8 +25,6 @@ const config = require(`${root}lib/config`) const Server = require(`${root}lib/server`) const Project = require(`${root}lib/project`) const Watchers = require(`${root}lib/watchers`) -const errors = require(`${root}lib/errors`) -const files = require(`${root}lib/controllers/files`) const pluginsModule = require(`${root}lib/plugins`) const preprocessor = require(`${root}lib/plugins/preprocessor`) const resolve = require(`${root}lib/plugins/resolve`) @@ -52,7 +40,7 @@ zlib = Promise.promisifyAll(zlib) const session = proxyquire('supertest-session', { supertest }) const absolutePathRegex = /"\/[^{}]*?\.projects/g -let sourceMapRegex = /\n\/\/# sourceMappingURL=.*$/im +let sourceMapRegex = /\n\/\/# sourceMappingURL\=.*/ const replaceAbsolutePaths = (content) => { return content.replace(absolutePathRegex, '"/') @@ -73,19 +61,6 @@ const cleanResponseBody = (body) => { return replaceAbsolutePaths(removeWhitespace(body)) } -const trimString = (s) => { - return _.trim(s) -} -const nonEmpty = (s) => { - return !_.isEmpty(s) -} - -sourceMapRegex = /\n\/\/# sourceMappingURL\=.*/ - -const removeSourceMapContents = (fileContents) => { - return fileContents.replace(sourceMapRegex, ';') -} - const browserifyFile = (filePath) => { return streamToPromise( browserify({ @@ -2909,8 +2884,6 @@ describe('Routes', () => { }) it('injects document.domain on https requests to same superdomain but different subdomain', function () { - const contents = removeWhitespace(Fixtures.get('server/expected_https_inject.html')) - return this.setup('https://www.foobar.com:8443') .then(() => { evilDns.add('*.foobar.com', '127.0.0.1') diff --git a/packages/server/test/integration/server_spec.js b/packages/server/test/integration/server_spec.js index 3d0f3d922b..96c97dfc07 100644 --- a/packages/server/test/integration/server_spec.js +++ b/packages/server/test/integration/server_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - default-case, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') @@ -355,6 +345,7 @@ describe('Server', () => { return res.end() } , Number(ms)) + default: } }) diff --git a/packages/server/test/integration/websockets_spec.js b/packages/server/test/integration/websockets_spec.js index ae5fe509d5..25e183c4eb 100644 --- a/packages/server/test/integration/websockets_spec.js +++ b/packages/server/test/integration/websockets_spec.js @@ -1,11 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' diff --git a/packages/server/test/performance/proxy_performance_spec.js b/packages/server/test/performance/proxy_performance_spec.js index dd8192b714..6de71ecd75 100644 --- a/packages/server/test/performance/proxy_performance_spec.js +++ b/packages/server/test/performance/proxy_performance_spec.js @@ -395,7 +395,6 @@ describe('Proxy Performance', function () { debug(`Done in ${Math.round((new Date() / 1000) - start)}s`) process.stdout.write('Note: All times are in milliseconds.\n') - // eslint-disable-next-line no-console console.table(testCases) return Promise.map(testCases, (testCase) => { diff --git a/packages/server/test/scripts/run.js b/packages/server/test/scripts/run.js index d7f522ff0c..e001902551 100644 --- a/packages/server/test/scripts/run.js +++ b/packages/server/test/scripts/run.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - const _ = require('lodash') const chalk = require('chalk') const minimist = require('minimist') diff --git a/packages/server/test/specUtils.ts b/packages/server/test/specUtils.ts index e8188ea660..eae319679f 100644 --- a/packages/server/test/specUtils.ts +++ b/packages/server/test/specUtils.ts @@ -2,9 +2,7 @@ import _ from 'lodash' import mockfs from 'mock-fs' import path from 'path' -// eslint-disable-next-line export const logFs = () => { - // eslint-disable-next-line no-console console.dir(getFs(), { depth: null }) } diff --git a/packages/server/test/spec_helper.js b/packages/server/test/spec_helper.js index be0c6c5146..f453638520 100644 --- a/packages/server/test/spec_helper.js +++ b/packages/server/test/spec_helper.js @@ -1,14 +1,3 @@ -/* eslint-disable - no-unused-vars, - prefer-rest-params, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../lib/environment') const chai = require('chai') @@ -26,7 +15,6 @@ const _ = require('lodash') const Promise = require('bluebird') const path = require('path') const cache = require('../lib/cache') -const appData = require('../lib/util/app_data') require('chai') .use(require('@cypress/sinon-chai')) @@ -52,10 +40,10 @@ let hasOnly = false; ['it', 'describe', 'context'].forEach((prop) => { const backup = global[prop].only - global[prop].only = function () { + global[prop].only = function (...args) { hasOnly = true - return backup.apply(this, arguments) + return backup.apply(this, args) } }) @@ -67,16 +55,14 @@ sinon.usingPromise(Promise) // backup these originals const { restore, -} = sinon -const { useFakeTimers, } = sinon -sinon.useFakeTimers = function () { - sinon._clock = useFakeTimers.apply(sinon, arguments) +sinon.useFakeTimers = function (...args) { + sinon._clock = useFakeTimers.apply(sinon, args) } -sinon.restore = function () { +sinon.restore = function (...args) { let c c = sinon._clock @@ -85,7 +71,7 @@ sinon.restore = function () { c.restore() } - return restore.apply(sinon, arguments) + return restore.apply(sinon, args) } mockery.enable({ 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 d71db5df22..35d8fca9fd 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 @@ -17,7 +17,6 @@ module.exports = (on, config) => { try { performance = require('../../../../test/support/helpers/performance') } catch (err) { - // eslint-disable-next-line no-console console.error(err) } @@ -154,7 +153,6 @@ module.exports = (on, config) => { '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`) }) 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 80446ed767..846b777bb9 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,2 +1 @@ -/* eslint-disable no-console */ console.log('bar') 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 af6bdba91c..b8577e357f 100644 --- a/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js +++ b/packages/server/test/support/fixtures/projects/e2e/reporters/custom.js @@ -1,4 +1,3 @@ -/* 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/e2e/reporters/uses-file.js b/packages/server/test/support/fixtures/projects/e2e/reporters/uses-file.js index 864336e8c9..0640469628 100644 --- a/packages/server/test/support/fixtures/projects/e2e/reporters/uses-file.js +++ b/packages/server/test/support/fixtures/projects/e2e/reporters/uses-file.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ module.exports = function Reporter (runner) { runner.on('suite', function (suite) { console.log('suite.file:', suite.file) diff --git a/packages/server/test/support/fixtures/projects/firefox-memory/cypress/plugins/index.js b/packages/server/test/support/fixtures/projects/firefox-memory/cypress/plugins/index.js index da588efb84..27da428049 100644 --- a/packages/server/test/support/fixtures/projects/firefox-memory/cypress/plugins/index.js +++ b/packages/server/test/support/fixtures/projects/firefox-memory/cypress/plugins/index.js @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - // *********************************************************** // This example plugins/index.js can be used to load plugins // diff --git a/packages/server/test/support/fixtures/projects/read-only-project-root/cypress/plugins/index.js b/packages/server/test/support/fixtures/projects/read-only-project-root/cypress/plugins/index.js index 9ac868c37a..1655288a0f 100644 --- a/packages/server/test/support/fixtures/projects/read-only-project-root/cypress/plugins/index.js +++ b/packages/server/test/support/fixtures/projects/read-only-project-root/cypress/plugins/index.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ const fs = require('fs') const { expect } = require('chai') diff --git a/packages/server/test/support/fixtures/projects/remote-debugging-disconnect/cypress/plugins.js b/packages/server/test/support/fixtures/projects/remote-debugging-disconnect/cypress/plugins.js index e6683eac0d..f4cb648450 100644 --- a/packages/server/test/support/fixtures/projects/remote-debugging-disconnect/cypress/plugins.js +++ b/packages/server/test/support/fixtures/projects/remote-debugging-disconnect/cypress/plugins.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ const la = require('lazy-ass') const net = require('net') diff --git a/packages/server/test/support/helpers/coverage.js b/packages/server/test/support/helpers/coverage.js index 505c23b405..3dbdff6c75 100644 --- a/packages/server/test/support/helpers/coverage.js +++ b/packages/server/test/support/helpers/coverage.js @@ -1,37 +1,34 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS209: Avoid top-level return - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const path = require("path"); -const coffeeCoverage = require("coffee-coverage"); +const path = require('path') +const coffeeCoverage = require('coffee-coverage') -if (!process.env["NODE_COVERAGE"]) { return; } +if (process.env['NODE_COVERAGE']) { + const projectRoot = path.resolve(__dirname, '../../..') + const coverageVar = coffeeCoverage.findIstanbulVariable() -const projectRoot = path.resolve(__dirname, "../../.."); -const coverageVar = coffeeCoverage.findIstanbulVariable(); + // Only write a coverage report if we"re not running inside of Istanbul. + const writeOnExit = coverageVar ? null : `${projectRoot}/coverage/coverage-coffee.json` -// Only write a coverage report if we"re not running inside of Istanbul. -const writeOnExit = coverageVar ? null : projectRoot + "/coverage/coverage-coffee.json"; + coffeeCoverage.register({ + instrumentor: 'istanbul', + basePath: projectRoot, + exclude: ['/gulpfile.coffee', '/deploy', '/build', '/dist', '/tmp', '/test', '/spec', '/app', '/bower_components', '/cache', '/support', '/node_modules', '/.git', '/.cy', '/.projects'], + coverageVar, + writeOnExit, + initAll: true, + }) -coffeeCoverage.register({ - instrumentor: "istanbul", - basePath: projectRoot, - exclude: ["/gulpfile.coffee", "/deploy", "/build", "/dist", "/tmp", "/test", "/spec", "/app", "/bower_components", "/cache", "/support", "/node_modules", "/.git", "/.cy", "/.projects"], - coverageVar, - writeOnExit, - initAll: true -}); + // using hack found here to prevent problems with + // coffee-coverage being replaced by modules which + // use coffeescript/register + // https://github.com/abresas/register-coffee-coverage/blob/master/index.js + const loader = require.extensions['.coffee'] -// using hack found here to prevent problems with -// coffee-coverage being replaced by modules which -// use coffeescript/register -// https://github.com/abresas/register-coffee-coverage/blob/master/index.js -const loader = require.extensions[".coffee"]; - -Object.defineProperty(require.extensions, ".coffee", { - get() { return loader; }, - set() { return loader; } -}); + Object.defineProperty(require.extensions, '.coffee', { + get () { + return loader + }, + set () { + return loader + }, + }) +} diff --git a/packages/server/test/support/helpers/e2e.ts b/packages/server/test/support/helpers/e2e.ts index ccc14e17ce..d992dda9bd 100644 --- a/packages/server/test/support/helpers/e2e.ts +++ b/packages/server/test/support/helpers/e2e.ts @@ -206,7 +206,6 @@ const startServer = function (obj) { return new Bluebird((resolve) => { return srv.listen(port, () => { - // eslint-disable-next-line no-console console.log(`listening on port: ${port}`) if (typeof onServer === 'function') { onServer(app, srv) diff --git a/packages/server/test/support/helpers/electron_stub.js b/packages/server/test/support/helpers/electron_stub.js index e0fccf6c0d..f88ab1733a 100644 --- a/packages/server/test/support/helpers/electron_stub.js +++ b/packages/server/test/support/helpers/electron_stub.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ // a stubbed out version of electron // for using in all of our tests :-) module.exports = { diff --git a/packages/server/test/support/helpers/fixtures.js b/packages/server/test/support/helpers/fixtures.js index 42c5e77242..56858cc2f1 100644 --- a/packages/server/test/support/helpers/fixtures.js +++ b/packages/server/test/support/helpers/fixtures.js @@ -1,15 +1,3 @@ -/* eslint-disable - no-console, - no-unused-vars, - prefer-rest-params, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const fs = require('fs-extra') const path = require('path') const chokidar = require('chokidar') @@ -41,18 +29,18 @@ module.exports = { }, scaffoldWatch () { - let w const watchdir = path.resolve(__dirname, '../fixtures/projects') console.log('watching files due to --no-exit', watchdir) - w = chokidar.watch(watchdir, { + chokidar.watch(watchdir, { }) .on('change', (srcFilepath, stats) => { const tmpFilepath = path.join(tmpDir, path.relative(watchdir, srcFilepath)) return copyContents(srcFilepath, tmpFilepath) - }).on('error', console.error) + }) + .on('error', console.error) }, // removes all of the project fixtures @@ -63,8 +51,8 @@ module.exports = { // returns the path to project fixture // in the tmpDir - project () { - return this.projectPath.apply(this, arguments) + project (...args) { + return this.projectPath.apply(this, args) }, projectPath (name) { diff --git a/packages/server/test/support/helpers/gzip.js b/packages/server/test/support/helpers/gzip.js index 6b4d67ee38..9fd00af034 100644 --- a/packages/server/test/support/helpers/gzip.js +++ b/packages/server/test/support/helpers/gzip.js @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ const fs = require('fs') const zlib = require('zlib') const path = require('path') diff --git a/packages/server/test/support/helpers/performance.js b/packages/server/test/support/helpers/performance.js index 6edc31f1fa..77d56c613d 100644 --- a/packages/server/test/support/helpers/performance.js +++ b/packages/server/test/support/helpers/performance.js @@ -57,7 +57,6 @@ function track (type, data) { }) }) .catch((err) => { - /* eslint-disable no-console */ console.error('Track error for type %s %s', type, err.message) }) } diff --git a/packages/server/test/support/helpers/process.js b/packages/server/test/support/helpers/process.js deleted file mode 100644 index 51ed1f23da..0000000000 --- a/packages/server/test/support/helpers/process.js +++ /dev/null @@ -1,19 +0,0 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -// a simple helper to detect when we're running -// under istanbul and automatically shift the -// cmd + arguments around so we continue to get -// test coverage - -module.exports = function (cmd, args) { - if (process.env.running_under_istanbul) { - return `npm run test-cov-process -- ${cmd} -- -- ${args}` - } - - return `${cmd} -- ${args}` -} diff --git a/packages/server/test/unit/api_spec.js b/packages/server/test/unit/api_spec.js index 8d4fb8aecd..567ca023f1 100644 --- a/packages/server/test/unit/api_spec.js +++ b/packages/server/test/unit/api_spec.js @@ -1,14 +1,3 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') @@ -18,7 +7,6 @@ const { } = require('@packages/network') const pkg = require('@packages/root') const api = require(`${root}lib/api`) -const browsers = require(`${root}lib/browsers`) const cache = require(`${root}lib/cache`) const machineId = require(`${root}lib/util/machine_id`) const Promise = require('bluebird') @@ -785,8 +773,8 @@ describe('lib/api', () => { it('caches the response from the first request', () => { return api.getAuthUrls() - .then(() => // nock will throw if this makes a second HTTP call - { + .then(() => { + // nock will throw if this makes a second HTTP call return api.getAuthUrls() }).then((urls) => { expect(urls).to.deep.eq(AUTH_URLS) diff --git a/packages/server/test/unit/args_spec.js b/packages/server/test/unit/args_spec.js index 056f4e2074..2e57eb3386 100644 --- a/packages/server/test/unit/args_spec.js +++ b/packages/server/test/unit/args_spec.js @@ -1,22 +1,10 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') -const _ = require('lodash') const path = require('path') const os = require('os') const snapshot = require('snap-shot-it') const stripAnsi = require('strip-ansi') const argsUtil = require(`${root}lib/util/args`) -const proxyUtil = require(`${root}lib/util/proxy`) const getWindowsProxyUtil = require(`${root}lib/util/get-windows-proxy`) const cwd = process.cwd() diff --git a/packages/server/test/unit/browsers/browsers_spec.js b/packages/server/test/unit/browsers/browsers_spec.js index fb2905a6ff..abfdda0261 100644 --- a/packages/server/test/unit/browsers/browsers_spec.js +++ b/packages/server/test/unit/browsers/browsers_spec.js @@ -1,17 +1,5 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') -const Promise = require('bluebird') -const Windows = require(`${root}../lib/gui/windows`) const browsers = require(`${root}../lib/browsers`) const utils = require(`${root}../lib/browsers/utils`) const snapshot = require('snap-shot-it') diff --git a/packages/server/test/unit/browsers/chrome_spec.js b/packages/server/test/unit/browsers/chrome_spec.js index 4cde9c34c9..be878999aa 100644 --- a/packages/server/test/unit/browsers/chrome_spec.js +++ b/packages/server/test/unit/browsers/chrome_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const os = require('os') @@ -17,7 +7,6 @@ const plugins = require(`${root}../lib/plugins`) const utils = require(`${root}../lib/browsers/utils`) const chrome = require(`${root}../lib/browsers/chrome`) const fs = require(`${root}../lib/util/fs`) -const errors = require(`${root}../lib/errors`) describe('lib/browsers/chrome', () => { context('#open', () => { @@ -98,8 +87,6 @@ describe('lib/browsers/chrome', () => { it('sets default window size in headless mode', function () { chrome._writeExtension.restore() - const pathToTheme = extension.getPathToTheme() - return chrome.open({ isHeadless: true, isHeaded: false }, 'http://', {}, this.automation) .then(() => { const args = utils.launch.firstCall.args[2] @@ -114,8 +101,6 @@ describe('lib/browsers/chrome', () => { it('does not load extension in headless mode', function () { chrome._writeExtension.restore() - const pathToTheme = extension.getPathToTheme() - return chrome.open({ isHeadless: true, isHeaded: false }, 'http://', {}, this.automation) .then(() => { const args = utils.launch.firstCall.args[2] diff --git a/packages/server/test/unit/browsers/electron_spec.js b/packages/server/test/unit/browsers/electron_spec.js index bdcc32932c..85701d28ac 100644 --- a/packages/server/test/unit/browsers/electron_spec.js +++ b/packages/server/test/unit/browsers/electron_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-undef, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const _ = require('lodash') @@ -393,6 +383,7 @@ describe('lib/browsers/electron', () => { } this.openNewWindow = (options) => { + // eslint-disable-next-line no-undef return launcher.launch('electron', this.url, options).then(() => { return this.win.webContents.emit('new-window', this.event, 'some://other.url') }) diff --git a/packages/server/test/unit/cache_buster_spec.js b/packages/server/test/unit/cache_buster_spec.js index c0ed5b8342..eb981877b1 100644 --- a/packages/server/test/unit/cache_buster_spec.js +++ b/packages/server/test/unit/cache_buster_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const CacheBuster = require(`${root}lib/util/cache_buster`) diff --git a/packages/server/test/unit/cache_spec.js b/packages/server/test/unit/cache_spec.js index caed31793f..fc53e5c67d 100644 --- a/packages/server/test/unit/cache_spec.js +++ b/packages/server/test/unit/cache_spec.js @@ -1,18 +1,7 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') +require(`${root}lib/cwd`) -const path = require('path') const Promise = require('bluebird') -const cwd = require(`${root}lib/cwd`) const cache = require(`${root}lib/cache`) const fs = require(`${root}lib/util/fs`) const Fixtures = require('../support/helpers/fixtures') diff --git a/packages/server/test/unit/capture_spec.js b/packages/server/test/unit/capture_spec.js index 7d47ab2947..716530f13c 100644 --- a/packages/server/test/unit/capture_spec.js +++ b/packages/server/test/unit/capture_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const capture = require(`${root}lib/capture`) diff --git a/packages/server/test/unit/chrome_policy_check.js b/packages/server/test/unit/chrome_policy_check.js index 3320615d13..5ed1350b58 100644 --- a/packages/server/test/unit/chrome_policy_check.js +++ b/packages/server/test/unit/chrome_policy_check.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') diff --git a/packages/server/test/unit/ci_provider_spec.js b/packages/server/test/unit/ci_provider_spec.js index 1ac2ab7e0e..05d47fa232 100644 --- a/packages/server/test/unit/ci_provider_spec.js +++ b/packages/server/test/unit/ci_provider_spec.js @@ -1,15 +1,3 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const R = require('ramda') const mockedEnv = require('mocked-env') require('../spec_helper') @@ -37,9 +25,9 @@ const expectsCommitDefaults = function (existing, expected) { describe('lib/util/ci_provider', () => { let resetEnv = null - afterEach(() => // we need to reset environment - // to avoid affecting tests in other suites - { + afterEach(() => { + // we need to reset environment + // to avoid affecting tests in other suites return typeof resetEnv === 'function' ? resetEnv() : undefined }) diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 2053c06e0b..116945f82f 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') diff --git a/packages/server/test/unit/duration_spec.js b/packages/server/test/unit/duration_spec.js index 0bc6773eba..251b567ee1 100644 --- a/packages/server/test/unit/duration_spec.js +++ b/packages/server/test/unit/duration_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const duration = require(`${root}lib/util/duration`) diff --git a/packages/server/test/unit/environment_spec.js b/packages/server/test/unit/environment_spec.js index 82c500d1ed..b369dfa470 100644 --- a/packages/server/test/unit/environment_spec.js +++ b/packages/server/test/unit/environment_spec.js @@ -1,19 +1,10 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const Promise = require('bluebird') const pkg = require('@packages/root') const fs = require(`${root}lib/util/fs`) const mockedEnv = require('mocked-env') -const { - app, -} = require('electron') +const { app } = require('electron') const setEnv = (env) => { process.env['CYPRESS_INTERNAL_ENV'] = env diff --git a/packages/server/test/unit/errors_spec.js b/packages/server/test/unit/errors_spec.js index 10d2446395..f0e9620fdc 100644 --- a/packages/server/test/unit/errors_spec.js +++ b/packages/server/test/unit/errors_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const style = require('ansi-styles') diff --git a/packages/server/test/unit/exceptions_spec.js b/packages/server/test/unit/exceptions_spec.js index c58e12a2d7..a809d9a9c3 100644 --- a/packages/server/test/unit/exceptions_spec.js +++ b/packages/server/test/unit/exceptions_spec.js @@ -1,25 +1,10 @@ -/* eslint-disable - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') delete global.fs const api = require(`${root}lib/api`) const user = require(`${root}lib/user`) -const logger = require(`${root}lib/logger`) -const cache = require(`${root}lib/cache`) const exception = require(`${root}lib/exception`) -const Routes = require(`${root}lib/util/routes`) -const Settings = require(`${root}lib/util/settings`) const system = require(`${root}lib/util/system`) const pkg = require('@packages/root') @@ -52,6 +37,7 @@ describe('lib/exceptions', () => { describe('fields', () => { beforeEach(function () { try { + // eslint-disable-next-line no-undef return foo.bar() } catch (err) { this.err = err diff --git a/packages/server/test/unit/exec_spec.js b/packages/server/test/unit/exec_spec.js index b1cdf26595..e367350155 100644 --- a/packages/server/test/unit/exec_spec.js +++ b/packages/server/test/unit/exec_spec.js @@ -1,17 +1,6 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') -const cp = require(`${root}lib/util/child_process`) const os = require('os') const exec = require(`${root}lib/exec`) diff --git a/packages/server/test/unit/file_spec.js b/packages/server/test/unit/file_spec.js index 50b54de4a6..c268e59edd 100644 --- a/packages/server/test/unit/file_spec.js +++ b/packages/server/test/unit/file_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const os = require('os') @@ -23,8 +16,8 @@ describe('lib/util/file', () => { return fs.removeAsync(this.dir).catch(() => {}) }) - // ignore error if directory didn't exist in the first place + // ignore error if directory didn't exist in the first place it('throws if path is not specified', () => { expect(() => { return new FileUtil() diff --git a/packages/server/test/unit/files_spec.js b/packages/server/test/unit/files_spec.js index 674b98c786..de0a37dc69 100644 --- a/packages/server/test/unit/files_spec.js +++ b/packages/server/test/unit/files_spec.js @@ -1,19 +1,8 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const config = require(`${root}lib/config`) const files = require(`${root}lib/files`) const FixturesHelper = require(`${root}/test/support/helpers/fixtures`) -const filesController = require(`${root}lib/controllers/files`) describe('lib/files', () => { beforeEach(function () { diff --git a/packages/server/test/unit/find_system_node_spec.js b/packages/server/test/unit/find_system_node_spec.js deleted file mode 100644 index 6822b036fc..0000000000 --- a/packages/server/test/unit/find_system_node_spec.js +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -require('../spec_helper') - -const findSystemNode = require(`${root}lib/util/find_system_node`) - -describe('lib/util/find_system_node', () => {}) diff --git a/packages/server/test/unit/fixture_spec.js b/packages/server/test/unit/fixture_spec.js index 5e760bc9ff..f9dda02e1b 100644 --- a/packages/server/test/unit/fixture_spec.js +++ b/packages/server/test/unit/fixture_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const path = require('path') @@ -431,10 +421,7 @@ John,Chef,1982 .then(() => { throw new Error('should have failed but did not') }).catch((err) => { - const p = `${this.fixturesFolder}/does-not-exist` - expect(err.message).to.include('A fixture file could not be found') - expect(err.message).to.include('/does-not-exist') }) }) diff --git a/packages/server/test/unit/fs_spec.js b/packages/server/test/unit/fs_spec.js index 42397bce8c..87b67dbc2d 100644 --- a/packages/server/test/unit/fs_spec.js +++ b/packages/server/test/unit/fs_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const fs = require(`${root}lib/util/fs`) @@ -23,7 +13,6 @@ describe('lib/util/fs', () => { expect(console.error).to.be.calledWith(warning) }) - // also print stack trace, maybe check that context('fs.pathExists', () => { it('finds this file', () => { diff --git a/packages/server/test/unit/gui/dialog_spec.js b/packages/server/test/unit/gui/dialog_spec.js index c0f739c941..cb7d5ab0d8 100644 --- a/packages/server/test/unit/gui/dialog_spec.js +++ b/packages/server/test/unit/gui/dialog_spec.js @@ -1,18 +1,7 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const electron = require('electron') const dialog = require(`${root}../lib/gui/dialog`) -const Windows = require(`${root}../lib/gui/windows`) describe('gui/dialog', () => { context('.show', () => { diff --git a/packages/server/test/unit/gui/events_spec.js b/packages/server/test/unit/gui/events_spec.js index 41a00b57a9..8c21facd7c 100644 --- a/packages/server/test/unit/gui/events_spec.js +++ b/packages/server/test/unit/gui/events_spec.js @@ -1,17 +1,5 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') -const _ = require('lodash') const EE = require('events') const extension = require('@packages/extension') const electron = require('electron') @@ -86,7 +74,7 @@ describe('lib/gui/events', () => { context('.start', () => { it('ipc attaches callback on request', () => { - const handleEvent = sinon.stub(events, 'handleEvent') + sinon.stub(events, 'handleEvent') events.start({ foo: 'bar' }) @@ -557,9 +545,7 @@ describe('lib/gui/events', () => { return sinon.stub(Project.prototype, 'getConfig').resolves({ some: 'config' }) }) - afterEach(() => // close down 'open' projects - // to prevent side effects - { + afterEach(() => { return openProject.close() }) diff --git a/packages/server/test/unit/gui/windows_spec.js b/packages/server/test/unit/gui/windows_spec.js index 602f6a14b4..abfac43b39 100644 --- a/packages/server/test/unit/gui/windows_spec.js +++ b/packages/server/test/unit/gui/windows_spec.js @@ -1,24 +1,11 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const _ = require('lodash') const path = require('path') const Promise = require('bluebird') const EE = require('events').EventEmitter -const { - BrowserWindow, -} = require('electron') +const { BrowserWindow } = require('electron') const cyDesktop = require('@packages/desktop-gui') -const user = require(`${root}../lib/user`) const Windows = require(`${root}../lib/gui/windows`) const savedState = require(`${root}../lib/saved_state`) diff --git a/packages/server/test/unit/human_time_spec.js b/packages/server/test/unit/human_time_spec.js index 6a9a443116..c61bd1148c 100644 --- a/packages/server/test/unit/human_time_spec.js +++ b/packages/server/test/unit/human_time_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const humanInterval = require('human-interval') diff --git a/packages/server/test/unit/konfig_spec.js b/packages/server/test/unit/konfig_spec.js index bb4c3e92f1..0190f17d80 100644 --- a/packages/server/test/unit/konfig_spec.js +++ b/packages/server/test/unit/konfig_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') describe('lib/konfig', () => { @@ -41,8 +31,6 @@ describe('lib/konfig', () => { }) it('memoizes the result', () => { - const env = process.env['NODE_ENV'] - process.env['NODE_ENV'] = 'development' const config = require(`${root}lib/konfig`) @@ -58,7 +46,7 @@ describe('lib/konfig', () => { delete process.env['NODE_ENV'] delete require.cache[require.resolve(`${root}lib/konfig`)] expect(process.env.hasOwnProperty('NODE_ENV')).to.eq(false) - const config = require(`${root}lib/konfig`) + require(`${root}lib/konfig`) expect(process.env.hasOwnProperty('NODE_ENV')).to.eq(false) process.env['NODE_ENV'] = env diff --git a/packages/server/test/unit/open_spec.js b/packages/server/test/unit/open_spec.js index e3bd74d2af..d69a2c01c7 100644 --- a/packages/server/test/unit/open_spec.js +++ b/packages/server/test/unit/open_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const cp = require('child_process') diff --git a/packages/server/test/unit/origin_spec.js b/packages/server/test/unit/origin_spec.js index aadeeb3f16..15876e2d15 100644 --- a/packages/server/test/unit/origin_spec.js +++ b/packages/server/test/unit/origin_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const origin = require(`${root}lib/util/origin`) diff --git a/packages/server/test/unit/path_helpers_spec.js b/packages/server/test/unit/path_helpers_spec.js index 19da49c75f..c75149236b 100644 --- a/packages/server/test/unit/path_helpers_spec.js +++ b/packages/server/test/unit/path_helpers_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const path_helpers = require(`${root}lib/util/path_helpers`) diff --git a/packages/server/test/unit/plugins/child/preprocessor_spec.js b/packages/server/test/unit/plugins/child/preprocessor_spec.js index d699ac5521..5030b4aa27 100644 --- a/packages/server/test/unit/plugins/child/preprocessor_spec.js +++ b/packages/server/test/unit/plugins/child/preprocessor_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../../spec_helper') const EE = require('events') diff --git a/packages/server/test/unit/plugins/child/run_plugins_spec.js b/packages/server/test/unit/plugins/child/run_plugins_spec.js index 9c68086b8c..884a89beed 100644 --- a/packages/server/test/unit/plugins/child/run_plugins_spec.js +++ b/packages/server/test/unit/plugins/child/run_plugins_spec.js @@ -1,17 +1,6 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../../spec_helper') const _ = require('lodash') -const cp = require('child_process') const snapshot = require('snap-shot-it') const preprocessor = require(`${root}../../lib/plugins/child/preprocessor`) @@ -24,9 +13,6 @@ const Fixtures = require(`${root}../../test/support/helpers/fixtures`) const colorCodeRe = /\[[0-9;]+m/gm const pathRe = /\/?([a-z0-9_-]+\/)*[a-z0-9_-]+\/([a-z_]+\.\w+)[:0-9]+/gmi -const withoutStack = (err) => { - return _.omit(err, 'stack') -} const withoutColorCodes = (str) => { return str.replace(colorCodeRe, '') } @@ -204,8 +190,6 @@ describe('lib/plugins/child/run_plugins', () => { }) it('wraps child promise', function () { - const args = ['arg1', 'arg2'] - this.ipc.on.withArgs('execute').yield('before:browser:launch', this.ids, this.args) expect(util.wrapChildPromise).to.be.called expect(util.wrapChildPromise.lastCall.args[0]).to.equal(this.ipc) diff --git a/packages/server/test/unit/plugins/child/task_spec.js b/packages/server/test/unit/plugins/child/task_spec.js index 46d4618485..23f25b3078 100644 --- a/packages/server/test/unit/plugins/child/task_spec.js +++ b/packages/server/test/unit/plugins/child/task_spec.js @@ -1,17 +1,5 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../../spec_helper') -const EE = require('events') - const util = require(`${root}../../lib/plugins/util`) const task = require(`${root}../../lib/plugins/child/task`) diff --git a/packages/server/test/unit/plugins/preprocessor_spec.js b/packages/server/test/unit/plugins/preprocessor_spec.js index 2f3669a50c..1b16663aae 100644 --- a/packages/server/test/unit/plugins/preprocessor_spec.js +++ b/packages/server/test/unit/plugins/preprocessor_spec.js @@ -1,17 +1,6 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const resolve = require('resolve') -const EE = require('events') const Fixtures = require('../../support/helpers/fixtures') const path = require('path') const appData = require(`${root}../lib/util/app_data`) diff --git a/packages/server/test/unit/plugins/util_spec.js b/packages/server/test/unit/plugins/util_spec.js index 9680378e9d..fc4dbe33f0 100644 --- a/packages/server/test/unit/plugins/util_spec.js +++ b/packages/server/test/unit/plugins/util_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../../spec_helper') const Promise = require('bluebird') @@ -208,7 +198,7 @@ describe('lib/plugins/util', () => { }) it('removes event listener once promise is fulfilled', function () { - const promise = util.wrapParentPromise(this.ipc, 0, this.callback) + util.wrapParentPromise(this.ipc, 0, this.callback) const invocationId = this.callback.lastCall.args[0] this.ipc.on.withArgs(`promise:fulfilled:${invocationId}`).yield(null, 'value') diff --git a/packages/server/test/unit/profile_cleaner_spec.js b/packages/server/test/unit/profile_cleaner_spec.js index 6a4f184eda..38beaf40f4 100644 --- a/packages/server/test/unit/profile_cleaner_spec.js +++ b/packages/server/test/unit/profile_cleaner_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const os = require('os') diff --git a/packages/server/test/unit/random_spec.js b/packages/server/test/unit/random_spec.js index 6dd60bcc05..4864243a7c 100644 --- a/packages/server/test/unit/random_spec.js +++ b/packages/server/test/unit/random_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const randomstring = require('randomstring') diff --git a/packages/server/test/unit/reporter_spec.js b/packages/server/test/unit/reporter_spec.js index e40224f4c0..6888b89131 100644 --- a/packages/server/test/unit/reporter_spec.js +++ b/packages/server/test/unit/reporter_spec.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-console, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const Reporter = require(`${root}lib/reporter`) diff --git a/packages/server/test/unit/routes_util_spec.js b/packages/server/test/unit/routes_util_spec.js index 825f965e1f..645cb61e8c 100644 --- a/packages/server/test/unit/routes_util_spec.js +++ b/packages/server/test/unit/routes_util_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const routes = require(`${root}/lib/util/routes`) diff --git a/packages/server/test/unit/saved_state_spec.js b/packages/server/test/unit/saved_state_spec.js index c93a92429c..993e742489 100644 --- a/packages/server/test/unit/saved_state_spec.js +++ b/packages/server/test/unit/saved_state_spec.js @@ -81,7 +81,6 @@ describe('lib/saved_state', () => { .then((state) => { return state.set({ foo: 'bar', baz: 'qux' }) }).then(() => { - // eslint-disable-next-line no-console expect(console.error).to.be.calledWith('WARNING: attempted to save state for non-whitelisted key(s): foo, baz. All keys must be whitelisted in server/lib/saved_state.js') }) }) diff --git a/packages/server/test/unit/server_spec.js b/packages/server/test/unit/server_spec.js index 59fb9f67a6..fdc42b1216 100644 --- a/packages/server/test/unit/server_spec.js +++ b/packages/server/test/unit/server_spec.js @@ -1,24 +1,10 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') const os = require('os') -const http = require('http') const express = require('express') const Promise = require('bluebird') -const { - connect, -} = require('@packages/network') -const routes = require(`${root}lib/routes`) +const { connect } = require('@packages/network') const config = require(`${root}lib/config`) const logger = require(`${root}lib/logger`) const Server = require(`${root}lib/server`) diff --git a/packages/server/test/unit/settings_spec.js b/packages/server/test/unit/settings_spec.js index a84ca717e7..ebdeb5503e 100644 --- a/packages/server/test/unit/settings_spec.js +++ b/packages/server/test/unit/settings_spec.js @@ -1,17 +1,6 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const path = require('path') -const R = require('ramda') const fs = require(`${root}lib/util/fs`) const settings = require(`${root}lib/util/settings`) @@ -72,8 +61,6 @@ describe('lib/settings', () => { }) }) - const noArguments = R.nAry(0) - it('does not write initial file', () => { return settings.readEnv(projectRoot) .then((obj) => { diff --git a/packages/server/test/unit/snapshot_spec.js b/packages/server/test/unit/snapshot_spec.js index 7fd502b354..34daa3d50d 100644 --- a/packages/server/test/unit/snapshot_spec.js +++ b/packages/server/test/unit/snapshot_spec.js @@ -1,22 +1,14 @@ -/* eslint-disable - mocha/no-global-tests, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const snapshot = require('snap-shot-it') +describe('snapshots', () => { // sanity check to make sure backtick escape works with our snapshots -it('saves snapshot with backticks', () => { - const text = `\ + it('saves snapshot with backticks', () => { + const text = `\ line 1 line 2 with \`42\` line 3 with \`foo\`\ ` - return snapshot('has backticks', text) + return snapshot('has backticks', text) + }) }) diff --git a/packages/server/test/unit/socket_spec.js b/packages/server/test/unit/socket_spec.js index 26eb691352..166595a3e6 100644 --- a/packages/server/test/unit/socket_spec.js +++ b/packages/server/test/unit/socket_spec.js @@ -1,22 +1,9 @@ -/* eslint-disable - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') -const os = require('os') const path = require('path') const Promise = require('bluebird') const socketIo = require('@packages/socket') -const extension = require('@packages/extension') const httpsAgent = require('https-proxy-agent') const errors = require(`${root}lib/errors`) const config = require(`${root}lib/config`) @@ -113,9 +100,10 @@ describe('lib/socket', () => { context('on(automation:request)', () => { describe('#onAutomation', () => { let extensionBackgroundPage = null + let chrome before(() => { - global.chrome = { + chrome = global.chrome = { cookies: { set () {}, getAll () {}, @@ -153,7 +141,7 @@ describe('lib/socket', () => { }) after(() => { - return delete global.chrome + chrome = null }) it('does not return cypress namespace or socket io cookies', function (done) { @@ -336,13 +324,13 @@ describe('lib/socket', () => { }) }) - it('calls callback with error on rejection', function () { - const err = new Error('foo') + it('calls callback with error on rejection', function (done) { + const error = new Error('foo') - this.ar.withArgs('focus', { foo: 'bar' }).rejects(err) + this.ar.withArgs('focus', { foo: 'bar' }).rejects(error) return this.client.emit('automation:request', 'focus', { foo: 'bar' }, (resp) => { - expect(resp).to.deep.eq({ __error: err.message, __name: err.name, __stack: err.stack }) + expect(resp.error.message).to.deep.eq(error.message) return done() }) @@ -574,7 +562,7 @@ describe('lib/socket', () => { context('constructor', () => { it('listens for \'file:updated\' on preprocessor', function () { this.cfg.watchForFileChanges = true - const socket = new Socket(this.cfg) + new Socket(this.cfg) expect(preprocessor.emitter.on).to.be.calledWith('file:updated') }) @@ -582,7 +570,7 @@ describe('lib/socket', () => { it('does not listen for \'file:updated\' if config.watchForFileChanges is false', function () { preprocessor.emitter.on.reset() this.cfg.watchForFileChanges = false - const socket = new Socket(this.cfg) + new Socket(this.cfg) expect(preprocessor.emitter.on).not.to.be.called }) diff --git a/packages/server/test/unit/spec_spec.js b/packages/server/test/unit/spec_spec.js index 2143a6bfcc..4a62a6d2a0 100644 --- a/packages/server/test/unit/spec_spec.js +++ b/packages/server/test/unit/spec_spec.js @@ -1,23 +1,10 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') -const _ = require('lodash') -const path = require('path') const spec = require(`${root}lib/controllers/spec`) const preprocessor = require(`${root}lib/plugins/preprocessor`) describe('lib/controllers/spec', () => { const specName = 'sample.js' - const specSource = ';' const outputFilePath = 'foo/bar/sample.js' beforeEach(function () { diff --git a/packages/server/test/unit/specs_spec.js b/packages/server/test/unit/specs_spec.js index e6b1cf271b..0b31c35f92 100644 --- a/packages/server/test/unit/specs_spec.js +++ b/packages/server/test/unit/specs_spec.js @@ -1,18 +1,7 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const R = require('ramda') const path = require('path') -const files = require(`${root}lib/files`) const config = require(`${root}lib/config`) const specsUtil = require(`${root}lib/util/specs`) const FixturesHelper = require(`${root}/test/support/helpers/fixtures`) diff --git a/packages/server/test/unit/status_code_spec.js b/packages/server/test/unit/status_code_spec.js index db9cc64765..6d7626ee5b 100644 --- a/packages/server/test/unit/status_code_spec.js +++ b/packages/server/test/unit/status_code_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const statusCode = require(`${root}lib/util/status_code`) diff --git a/packages/server/test/unit/task_spec.js b/packages/server/test/unit/task_spec.js index d7f0a76275..367ec3e54f 100644 --- a/packages/server/test/unit/task_spec.js +++ b/packages/server/test/unit/task_spec.js @@ -1,24 +1,9 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') -const _ = require('lodash') const Promise = require('bluebird') const plugins = require(`${root}lib/plugins`) const task = require(`${root}lib/task`) -const fail = function (message) { - throw new Error(message) -} - describe('lib/task', () => { beforeEach(function () { this.pluginsFile = 'cypress/plugins' diff --git a/packages/server/test/unit/terminal_spec.js b/packages/server/test/unit/terminal_spec.js index ca3fd7daac..73e51e7a2e 100644 --- a/packages/server/test/unit/terminal_spec.js +++ b/packages/server/test/unit/terminal_spec.js @@ -1,17 +1,5 @@ -/* eslint-disable - no-console, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') -const _ = require('lodash') const snapshot = require('snap-shot-it') const stripAnsi = require('strip-ansi') const widestLine = require('widest-line') diff --git a/packages/server/test/unit/trash_spec.js b/packages/server/test/unit/trash_spec.js index 3560026a04..a8d4aecb0e 100644 --- a/packages/server/test/unit/trash_spec.js +++ b/packages/server/test/unit/trash_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const fs = require('fs') diff --git a/packages/server/test/unit/tty_spec.js b/packages/server/test/unit/tty_spec.js index 8dd13e5e31..df66cc0493 100644 --- a/packages/server/test/unit/tty_spec.js +++ b/packages/server/test/unit/tty_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const tty = require('tty') diff --git a/packages/server/test/unit/updater_spec.js b/packages/server/test/unit/updater_spec.js index 3e90e6c2f5..d1f0305fb2 100644 --- a/packages/server/test/unit/updater_spec.js +++ b/packages/server/test/unit/updater_spec.js @@ -1,17 +1,7 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') +require(`${root}lib/cwd`) const nmi = require('node-machine-id') -const cwd = require(`${root}lib/cwd`) const request = require('@cypress/request') const Updater = require(`${root}lib/updater`) const pkg = require('@packages/root') diff --git a/packages/server/test/unit/user_spec.js b/packages/server/test/unit/user_spec.js index 74d7457574..e7ed9f0853 100644 --- a/packages/server/test/unit/user_spec.js +++ b/packages/server/test/unit/user_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const api = require(`${root}lib/api`) diff --git a/packages/server/test/unit/validation_spec.js b/packages/server/test/unit/validation_spec.js index 9019f6242e..d172d59697 100644 --- a/packages/server/test/unit/validation_spec.js +++ b/packages/server/test/unit/validation_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const snapshot = require('snap-shot-it') const v = require(`${root}lib/util/validation`) diff --git a/packages/server/test/unit/watchers_spec.js b/packages/server/test/unit/watchers_spec.js index 28b1269231..8ff42616fa 100644 --- a/packages/server/test/unit/watchers_spec.js +++ b/packages/server/test/unit/watchers_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const _ = require('lodash') diff --git a/packages/server/test/unit/xhrs_spec.js b/packages/server/test/unit/xhrs_spec.js index 577707e989..446a831616 100644 --- a/packages/server/test/unit/xhrs_spec.js +++ b/packages/server/test/unit/xhrs_spec.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ require('../spec_helper') const xhrs = require(`${root}lib/controllers/xhrs`) diff --git a/scripts/binary/ask.js b/scripts/binary/ask.js index b15a91fde2..30421306cc 100644 --- a/scripts/binary/ask.js +++ b/scripts/binary/ask.js @@ -1,21 +1,8 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') let fs = require('fs-extra') let glob = require('glob') const Promise = require('bluebird') const inquirer = require('inquirer') -const la = require('lazy-ass') -const check = require('check-more-types') const path = require('path') glob = Promise.promisify(glob) @@ -190,8 +177,7 @@ const whichZipFile = () => { .get('zipFile') } -const whichVersion = (distDir) => // realpath returns the absolute full path -{ +const whichVersion = (distDir) => { return glob('*/package.json', { cwd: distDir, realpath: true }) .map((pkg) => { return fs.readJsonAsync(pkg) @@ -204,8 +190,7 @@ const whichVersion = (distDir) => // realpath returns the absolute full path }) } -const whichRelease = (distDir) => // realpath returns the absolute full path -{ +const whichRelease = (distDir) => { return glob('*/package.json', { cwd: distDir, realpath: true }) .map((pkg) => { return fs.readJsonAsync(pkg) diff --git a/scripts/binary/build.js b/scripts/binary/build.js index 39061022c6..89034c78a8 100644 --- a/scripts/binary/build.js +++ b/scripts/binary/build.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const fse = require('fs-extra') const os = require('os') @@ -28,7 +18,6 @@ const debug = require('debug')('cypress:binary') const R = require('ramda') const la = require('lazy-ass') const check = require('check-more-types') -const humanInterval = require('human-interval') const meta = require('./meta') const smoke = require('./smoke') @@ -97,18 +86,6 @@ const buildCypressApp = function (platform, version, options = {}) { return testStaticAssets(distDir()) } - const canBuildInDocker = () => { - return (platform === 'linux') && (os.platform() === 'darwin') - } - - const badPlatformMismatch = function () { - console.error(`⛔️ cannot build ${platform} from ${os.platform()}`) - console.error('⛔️ should use matching platform to build it') - console.error('program arguments') - - return console.error(process.argv) - } - const checkPlatform = function () { log('#checkPlatform') if (platform === os.platform()) { diff --git a/scripts/binary/bump.js b/scripts/binary/bump.js index 940c3ee37d..a3ae872e27 100644 --- a/scripts/binary/bump.js +++ b/scripts/binary/bump.js @@ -1,30 +1,15 @@ -/* eslint-disable - brace-style, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') -let fs = require('fs-extra') const Promise = require('bluebird') const bumpercar = require('@cypress/bumpercar') const path = require('path') const la = require('lazy-ass') const check = require('check-more-types') const R = require('ramda') -const os = require('os') const { configFromEnvOrJsonFile, filenameToShellVariable } = require('@cypress/env-or-json-file') const makeEmptyGithubCommit = require('make-empty-github-commit') const parse = require('parse-github-repo-url') const { setCommitStatus } = require('@cypress/github-commit-status-check') -fs = Promise.promisifyAll(fs) - let car = null // all the projects to trigger / run / change environment variables for @@ -361,9 +346,9 @@ Testing new Cypress version ${version} } return makeEmptyGithubCommit(specificBranchOptions) - .catch(() => // maybe there is no branch for next version - // try default branch - { + .catch(() => { + // maybe there is no branch for next version + // try default branch return makeEmptyGithubCommit(defaultOptions) }).then(createGithubCommitStatusCheck) } diff --git a/scripts/binary/index.js b/scripts/binary/index.js index 6fb661e0bb..ebfb78aff7 100644 --- a/scripts/binary/index.js +++ b/scripts/binary/index.js @@ -1,14 +1,3 @@ -/* eslint-disable - default-case, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ // store the cwd const cwd = process.cwd() @@ -133,6 +122,8 @@ const deploy = { .then((v) => { return bump.version(v) }) + default: + throw new Error('unknown task') } }) }, diff --git a/scripts/binary/log.js b/scripts/binary/log.js index 56fcb5c22d..37d71d1bc8 100644 --- a/scripts/binary/log.js +++ b/scripts/binary/log.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const chalk = require('chalk') module.exports = function (msg, color = 'yellow') { diff --git a/scripts/binary/meta.js b/scripts/binary/meta.js index 7758c25a57..eb25b5e5bc 100644 --- a/scripts/binary/meta.js +++ b/scripts/binary/meta.js @@ -1,13 +1,3 @@ -/* eslint-disable - default-case, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const path = require('path') const la = require('lazy-ass') const check = require('check-more-types') @@ -55,6 +45,8 @@ const buildDir = function (platform, ...args) { // x86 32bit architecture return path.resolve(root, 'win-ia32-unpacked', ...args) + default: + throw new Error('unexpected platform') } } @@ -75,6 +67,8 @@ const zipDir = function (platform) { return buildDir(platform) case 'win32': return buildDir(platform) + default: + throw new Error('unexpected platform') } } @@ -89,6 +83,8 @@ const buildAppDir = function (platform, ...args) { return buildDir(platform, 'resources', 'app', ...args) case 'win32': return buildDir(platform, 'resources', 'app', ...args) + default: + throw new Error('unexpected platform') } } @@ -101,6 +97,8 @@ const buildAppExecutable = function (platform) { return buildDir(platform, 'Cypress') case 'win32': return buildDir(platform, 'Cypress') + default: + throw new Error('unexpected platform') } } diff --git a/scripts/binary/smoke.js b/scripts/binary/smoke.js index 3acdd60db5..35ffdbc3c4 100644 --- a/scripts/binary/smoke.js +++ b/scripts/binary/smoke.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const fse = require('fs-extra') const cp = require('child_process') diff --git a/scripts/binary/upload-npm-package.js b/scripts/binary/upload-npm-package.js index 93bd431c71..141661fee4 100644 --- a/scripts/binary/upload-npm-package.js +++ b/scripts/binary/upload-npm-package.js @@ -1,13 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const minimist = require('minimist') const Promise = require('bluebird') const la = require('lazy-ass') @@ -18,8 +8,6 @@ const awspublish = require('gulp-awspublish') const rename = require('gulp-rename') const gulpDebug = require('gulp-debug') const gulp = require('gulp') -const human = require('human-interval') -const R = require('ramda') const uploadUtils = require('./util/upload') const npmPackageExtension = '.tgz' diff --git a/scripts/binary/upload-unique-binary.js b/scripts/binary/upload-unique-binary.js index 43ddce00b3..e6b0fca2ee 100644 --- a/scripts/binary/upload-unique-binary.js +++ b/scripts/binary/upload-unique-binary.js @@ -1,14 +1,3 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const minimist = require('minimist') const Promise = require('bluebird') const la = require('lazy-ass') @@ -19,7 +8,6 @@ const awspublish = require('gulp-awspublish') const rename = require('gulp-rename') const gulpDebug = require('gulp-debug') const gulp = require('gulp') -const human = require('human-interval') const R = require('ramda') const hasha = require('hasha') diff --git a/scripts/binary/upload.js b/scripts/binary/upload.js index d75b45be46..3996738795 100644 --- a/scripts/binary/upload.js +++ b/scripts/binary/upload.js @@ -1,22 +1,9 @@ -/* eslint-disable - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const awspublish = require('gulp-awspublish') const rename = require('gulp-rename') const gulpDebug = require('gulp-debug') let fs = require('fs-extra') -const cp = require('child_process') const path = require('path') const gulp = require('gulp') -const human = require('human-interval') const Promise = require('bluebird') const meta = require('./meta') const la = require('lazy-ass') @@ -188,7 +175,7 @@ module.exports = { p.dirname = this.getUploadDirName({ version, platform }) return p - })).pipe(debug()) + })).pipe(gulpDebug()) .pipe(publisher.publish(headers)) .pipe(awspublish.reporter()) .on('error', reject) diff --git a/scripts/binary/util/packages.js b/scripts/binary/util/packages.js index 3e584f3d1a..8fdf228708 100644 --- a/scripts/binary/util/packages.js +++ b/scripts/binary/util/packages.js @@ -1,19 +1,5 @@ -/* eslint-disable - brace-style, - no-undef, - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') let fs = require('fs-extra') -const cp = require('child_process') const path = require('path') // we wrap glob to handle EMFILE error let glob = require('glob') @@ -95,32 +81,33 @@ const copyAllToDist = function (distDir) { } const copyPackage = function (pkg) { - let globOptions - console.log('** copy package: %s **', pkg) // copies the package to dist // including the default paths // and any specified in package.json files return Promise.resolve(fs.readJsonAsync(pathToPackageJson(pkg))) - .then((json) => // grab all the files that match "files" wildcards - // but without all negated files ("!src/**/*.spec.js" for example) - // and default included paths - // and convert to relative paths - { + .then((json) => { + // grab all the files that match "files" wildcards + // but without all negated files ("!src/**/*.spec.js" for example) + // and default included paths + // and convert to relative paths return DEFAULT_PATHS .concat(json.files || []) .concat(json.main || []) - }).then((pkgFileMasks) => {}, - debug('for pkg %s have the following file masks %o', pkg, pkgFileMasks), - (globOptions = { + }).then((pkgFileMasks) => { + debug('for pkg %s have the following file masks %o', pkg, pkgFileMasks) + const globOptions = { cwd: pkg, // search in the package folder absolute: false, // and return relative file paths followSymbolicLinks: false, // do not follow symlinks - }), - externalUtils.globby(pkgFileMasks, globOptions)).map((foundFileRelativeToPackageFolder) => { + } + + return externalUtils.globby(pkgFileMasks, globOptions) + }).map((foundFileRelativeToPackageFolder) => { return path.join(pkg, foundFileRelativeToPackageFolder) - }).tap(debug) + }) + .tap(debug) .map(copyRelativePathToDist, { concurrency: 1 }) } @@ -172,8 +159,8 @@ const removeDevDependencies = function (packageFolder) { const retryGlobbing = function (pathToPackages, delay = 1000) { const retryGlob = () => { return glob(pathToPackages) - .catch({ code: 'EMFILE' }, () => // wait, then retry - { + .catch({ code: 'EMFILE' }, () => { + // wait, then retry return Promise .delay(delay) .then(retryGlob) @@ -259,9 +246,6 @@ const symlinkAll = function (pathToDistPackages, pathTo) { la(check.unemptyString(pathToDistPackages), 'missing paths to dist packages', pathToDistPackages) - const baseDir = path.dirname(pathTo()) - const toBase = path.relative.bind(null, baseDir) - const symlink = function (pkg) { // console.log(pkg, dist) // strip off the initial './' diff --git a/scripts/binary/util/upload.js b/scripts/binary/util/upload.js index dd400efd2f..8cc49195f0 100644 --- a/scripts/binary/util/upload.js +++ b/scripts/binary/util/upload.js @@ -1,20 +1,9 @@ -/* eslint-disable - no-unused-vars, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const _ = require('lodash') const path = require('path') const awspublish = require('gulp-awspublish') const human = require('human-interval') const la = require('lazy-ass') const check = require('check-more-types') -const cp = require('child_process') const fse = require('fs-extra') const os = require('os') const Promise = require('bluebird') diff --git a/scripts/binary/zip.js b/scripts/binary/zip.js index 1cf69a272f..91985a9909 100644 --- a/scripts/binary/zip.js +++ b/scripts/binary/zip.js @@ -1,10 +1,3 @@ -// TODO: This file was created by bulk-decaffeinate. -// Sanity-check the conversion and remove this comment. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const Promise = require('bluebird') const os = require('os') const execa = require('execa')