diff --git a/packages/desktop-gui/cypress/fixtures/config.json b/packages/desktop-gui/cypress/fixtures/config.json index c7f349d5005f..de37a288517f 100644 --- a/packages/desktop-gui/cypress/fixtures/config.json +++ b/packages/desktop-gui/cypress/fixtures/config.json @@ -132,7 +132,6 @@ "integrationFolder": "/Users/jennifer/Dev/Projects/cypress-example-kitchensink/cypress/integration", "isHeadless": false, "isNewProject": false, - "javascripts": [], "morgan": true, "namespace": "__cypress", "numTestsKeptInMemory": 50, diff --git a/packages/driver/src/cypress.ts b/packages/driver/src/cypress.ts index 515f4a3c8fd5..c8712eeb8d48 100644 --- a/packages/driver/src/cypress.ts +++ b/packages/driver/src/cypress.ts @@ -136,7 +136,7 @@ class $Cypress { // change this in the NEXT_BREAKING const { env } = config - config = _.omit(config, 'env', 'remote', 'resolved', 'scaffoldedFiles', 'javascripts', 'state', 'testingType') + config = _.omit(config, 'env', 'remote', 'resolved', 'scaffoldedFiles', 'state', 'testingType') _.extend(this, browserInfo(config)) diff --git a/packages/server/lib/config_options.ts b/packages/server/lib/config_options.ts index 9e386998b4f5..2c02b10dada7 100644 --- a/packages/server/lib/config_options.ts +++ b/packages/server/lib/config_options.ts @@ -137,10 +137,6 @@ export const options = [ name: 'isTextTerminal', defaultValue: false, isInternal: true, - }, { - name: 'javascripts', - defaultValue: [], - isInternal: true, }, { name: 'morgan', defaultValue: true, diff --git a/packages/server/lib/controllers/files.js b/packages/server/lib/controllers/files.js index 0d5a71c76630..eb28f9fa0f51 100644 --- a/packages/server/lib/controllers/files.js +++ b/packages/server/lib/controllers/files.js @@ -32,7 +32,7 @@ module.exports = { return this.getSpecs(test, config, extraOptions) .then((specs) => { - return this.getJavascripts(config) + return this.getSupportFile(config) .then((js) => { const allFilesToSend = js.concat(specs) @@ -142,14 +142,13 @@ module.exports = { return test }, - getJavascripts (config) { - const { projectRoot, supportFile, javascripts } = config + getSupportFile (config) { + const { projectRoot, supportFile } = config - // automatically add in support scripts and any javascripts - let files = [].concat(javascripts) + let files = [] if (supportFile !== false) { - files = [supportFile].concat(files) + files = [supportFile] } // TODO: there shouldn't be any reason diff --git a/packages/server/lib/specs-store.ts b/packages/server/lib/specs-store.ts index 90a3ff2e5a20..830c7d9a8365 100644 --- a/packages/server/lib/specs-store.ts +++ b/packages/server/lib/specs-store.ts @@ -10,7 +10,7 @@ interface SpecsWatcherOptions { onSpecsChanged: (specFiles: SpecFiles) => void } -const COMMON_SEARCH_OPTIONS = ['fixturesFolder', 'supportFile', 'projectRoot', 'javascripts', 'testFiles', 'ignoreTestFiles'] +const COMMON_SEARCH_OPTIONS = ['fixturesFolder', 'supportFile', 'projectRoot', 'testFiles', 'ignoreTestFiles'] // TODO: shouldn't this be on the trailing edge, not leading? const debounce = (fn) => _.debounce(fn, 250, { leading: true }) diff --git a/packages/server/lib/util/specs.js b/packages/server/lib/util/specs.js index 059cb9dbf1ab..ef387fc8f9cb 100644 --- a/packages/server/lib/util/specs.js +++ b/packages/server/lib/util/specs.js @@ -69,22 +69,14 @@ function findSpecsOfType (searchOptions, specPattern) { const supportFilePath = searchOptions.supportFile || [] - // map all of the javascripts to the project root // TODO: think about moving this into config - // and mapping each of the javascripts into an - // absolute path - const javascriptsPaths = _.map(searchOptions.javascripts, (js) => { - return path.join(searchOptions.projectRoot, js) - }) - - // ignore fixtures + javascripts + // ignore fixtures const options = { sort: true, absolute: true, nodir: true, cwd: searchFolderPath, ignore: _.compact(_.flatten([ - javascriptsPaths, supportFilePath, fixturesFolderPath, ])), @@ -183,7 +175,7 @@ function findSpecsOfType (searchOptions, specPattern) { * with one of TEST_TYPES values. */ const find = (config, specPattern) => { - const commonSearchOptions = ['fixturesFolder', 'supportFile', 'projectRoot', 'javascripts', 'testFiles', 'ignoreTestFiles'] + const commonSearchOptions = ['fixturesFolder', 'supportFile', 'projectRoot', 'testFiles', 'ignoreTestFiles'] const componentTestingEnabled = _.get(config, 'resolved.testingType.value', 'e2e') === 'component' diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index dd253120d333..ced0ba35c9d1 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -449,13 +449,12 @@ describe('Routes', () => { integrationFolder: 'tests', fixturesFolder: 'tests/_fixtures', supportFile: 'tests/_support/spec_helper.js', - javascripts: ['tests/etc/**/*'], }, }) }) it('returns base json file path objects of only tests', function () { - // this should omit any _fixture files, _support files and javascripts + // this should omit any _fixture files, _support files return glob(path.join(Fixtures.projectPath('todos'), 'tests', '_fixtures', '**', '*')) .then((files) => { // make sure there are fixtures in here! @@ -477,7 +476,7 @@ describe('Routes', () => { body, } = res - expect(body.integration).to.have.length(4) + expect(body.integration).to.have.length(5) // remove the absolute path key body.integration = _.map(body.integration, (obj) => { @@ -487,8 +486,12 @@ describe('Routes', () => { expect(res.body).to.deep.eq({ integration: [ { - 'name': 'sub/a&b%c.js', - 'relative': 'tests/sub/a&b%c.js', + name: 'etc/etc.js', + relative: 'tests/etc/etc.js', + }, + { + name: 'sub/a&b%c.js', + relative: 'tests/sub/a&b%c.js', }, { name: 'sub/sub_test.coffee', @@ -738,7 +741,7 @@ describe('Routes', () => { projectRoot: Fixtures.projectPath('no-server'), config: { integrationFolder: 'my-tests', - javascripts: ['helpers/includes.js'], + supportFile: 'helpers/includes.js', }, }) }) @@ -752,7 +755,7 @@ describe('Routes', () => { }) }) - it('processes helpers/includes.js javascripts', function () { + it('processes helpers/includes.js supportFile', function () { return this.rp('http://localhost:2020/__cypress/tests?p=helpers/includes.js') .then((res) => { expect(res.statusCode).to.eq(200) @@ -1108,7 +1111,6 @@ describe('Routes', () => { integrationFolder: 'tests', fixturesFolder: 'tests/_fixtures', supportFile: 'tests/_support/spec_helper.js', - javascripts: ['tests/etc/etc.js'], }, }, {}, spec) } diff --git a/packages/server/test/support/fixtures/server/expected_todos_filtered_tests_iframe.html b/packages/server/test/support/fixtures/server/expected_todos_filtered_tests_iframe.html index 7cb5fb026838..3fb3f315c145 100644 --- a/packages/server/test/support/fixtures/server/expected_todos_filtered_tests_iframe.html +++ b/packages/server/test/support/fixtures/server/expected_todos_filtered_tests_iframe.html @@ -13,7 +13,7 @@ if (!Cypress) { throw new Error("Tests cannot run without a reference to Cypress!"); } - return Cypress.onSpecWindow(window, [{"absolute":"//todos/tests/_support/spec_helper.js","relative":"tests/_support/spec_helper.js","relativeUrl":"/__cypress/tests?p=tests/_support/spec_helper.js"},{"absolute":"//todos/tests/etc/etc.js","relative":"tests/etc/etc.js","relativeUrl":"/__cypress/tests?p=tests/etc/etc.js"},{"absolute":"//todos/tests/sub/sub_test.coffee","relative":"tests/sub/sub_test.coffee","relativeUrl":"/__cypress/tests?p=tests/sub/sub_test.coffee"}]); + return Cypress.onSpecWindow(window, [{"absolute":"//todos/tests/_support/spec_helper.js","relative":"tests/_support/spec_helper.js","relativeUrl":"/__cypress/tests?p=tests/_support/spec_helper.js"},{"absolute":"//todos/tests/sub/sub_test.coffee","relative":"tests/sub/sub_test.coffee","relativeUrl":"/__cypress/tests?p=tests/sub/sub_test.coffee"}]); })(window.opener || window.parent); diff --git a/packages/server/test/support/fixtures/server/expected_todos_iframe.html b/packages/server/test/support/fixtures/server/expected_todos_iframe.html index 6129dd961b7d..c382660d0b53 100644 --- a/packages/server/test/support/fixtures/server/expected_todos_iframe.html +++ b/packages/server/test/support/fixtures/server/expected_todos_iframe.html @@ -13,7 +13,7 @@ if (!Cypress) { throw new Error("Tests cannot run without a reference to Cypress!"); } - return Cypress.onSpecWindow(window, [{"absolute":"//todos/tests/_support/spec_helper.js","relative":"tests/_support/spec_helper.js","relativeUrl":"/__cypress/tests?p=tests/_support/spec_helper.js"},{"absolute":"//todos/tests/etc/etc.js","relative":"tests/etc/etc.js","relativeUrl":"/__cypress/tests?p=tests/etc/etc.js"},{"absolute":"//todos/tests/test2.coffee","relative":"tests/test2.coffee","relativeUrl":"/__cypress/tests?p=tests/test2.coffee"}]); + return Cypress.onSpecWindow(window, [{"absolute":"//todos/tests/_support/spec_helper.js","relative":"tests/_support/spec_helper.js","relativeUrl":"/__cypress/tests?p=tests/_support/spec_helper.js"},{"absolute":"//todos/tests/test2.coffee","relative":"tests/test2.coffee","relativeUrl":"/__cypress/tests?p=tests/test2.coffee"}]); })(window.opener || window.parent); diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 29ff3240ccec..0d35983df67d 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -1137,10 +1137,6 @@ describe('lib/config', () => { }) }) - it('javascripts=[]', function () { - return this.defaults('javascripts', []) - }) - it('viewportWidth=1000', function () { return this.defaults('viewportWidth', 1000) })