From f1ecbaf5f0f350b53ebcef7d898e2769a06984d8 Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Mon, 24 Aug 2020 14:38:52 -0400 Subject: [PATCH] fix: Fix support for .mjs files --- packages/server/__snapshots__/3_plugins_spec.js | 2 +- packages/server/package.json | 2 +- packages/server/test/e2e/3_plugins_spec.js | 7 +++++++ .../fixtures/projects/e2e/cypress/fixtures/mjs_file.mjs | 1 + .../projects/e2e/cypress/integration/mjs_spec.mjs | 5 +++++ yarn.lock | 8 ++++---- 6 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 packages/server/test/support/fixtures/projects/e2e/cypress/fixtures/mjs_file.mjs create mode 100644 packages/server/test/support/fixtures/projects/e2e/cypress/integration/mjs_spec.mjs diff --git a/packages/server/__snapshots__/3_plugins_spec.js b/packages/server/__snapshots__/3_plugins_spec.js index ebe43b1b2a64..5b676f189e05 100644 --- a/packages/server/__snapshots__/3_plugins_spec.js +++ b/packages/server/__snapshots__/3_plugins_spec.js @@ -1,4 +1,4 @@ -exports['e2e plugins passes with working preprocessor 1'] = ` +exports['e2e plugins preprocessor passes with working preprocessor 1'] = ` ==================================================================================================== diff --git a/packages/server/package.json b/packages/server/package.json index a0778a194229..530b81398e66 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -27,7 +27,7 @@ "@cypress/mocha-teamcity-reporter": "1.0.0", "@cypress/request": "2.88.5", "@cypress/request-promise": "4.2.6", - "@cypress/webpack-batteries-included-preprocessor": "2.0.1", + "@cypress/webpack-batteries-included-preprocessor": "2.1.1", "@cypress/webpack-preprocessor": "5.4.4", "@ffmpeg-installer/ffmpeg": "1.0.20", "ansi_up": "4.0.4", diff --git a/packages/server/test/e2e/3_plugins_spec.js b/packages/server/test/e2e/3_plugins_spec.js index 009958476ffc..857f35e04ffb 100644 --- a/packages/server/test/e2e/3_plugins_spec.js +++ b/packages/server/test/e2e/3_plugins_spec.js @@ -175,6 +175,13 @@ describe('e2e plugins', function () { spec: 'node_builtins_spec.js', }) }) + + // https://github.com/cypress-io/cypress/issues/8361 + it('supports .mjs files', function () { + return e2e.exec(this, { + spec: 'mjs_spec.mjs', + }) + }) }) describe('projectRoot and configFile', function () { diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/fixtures/mjs_file.mjs b/packages/server/test/support/fixtures/projects/e2e/cypress/fixtures/mjs_file.mjs new file mode 100644 index 000000000000..adce001e24fb --- /dev/null +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/fixtures/mjs_file.mjs @@ -0,0 +1 @@ +export const imFromMjs = 'I am from .mjs :)' diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/mjs_spec.mjs b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/mjs_spec.mjs new file mode 100644 index 000000000000..a5a99ef8dafc --- /dev/null +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/mjs_spec.mjs @@ -0,0 +1,5 @@ +import { imFromMjs } from '../fixtures/mjs_file' + +it('supports .mjs', () => { + expect(imFromMjs).to.equal('I am from .mjs :)') +}) diff --git a/yarn.lock b/yarn.lock index 6aef2bd18927..e396e3ef79dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1934,10 +1934,10 @@ dependencies: css.escape "^1.5.1" -"@cypress/webpack-batteries-included-preprocessor@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cypress/webpack-batteries-included-preprocessor/-/webpack-batteries-included-preprocessor-2.0.1.tgz#1c3aa575ead5f3f2f5a1da149e57a9ed30895813" - integrity sha512-pBg80Yur3GivxBiVsm62UFBrTIz/SnoPl2l2ybOR+O3DcbJIuxKFUbCqyDZ3tFP6POE8d/Zb2NgZCeLWSKsOVQ== +"@cypress/webpack-batteries-included-preprocessor@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cypress/webpack-batteries-included-preprocessor/-/webpack-batteries-included-preprocessor-2.1.1.tgz#4f914a25b2f3b619a1ee94418418c1635d75732f" + integrity sha512-2VOP1pyv8CNE5yGlebV4WnSffH4WymjZSUoww3Au8el2+xUY76uu1yr7Xpc2Tumey0JqI8lCikTYuNQ5GSf32A== dependencies: "@babel/core" "^7.11.1" "@babel/plugin-proposal-class-properties" "^7.10.4"