diff --git a/circle.yml b/circle.yml index db5897dda14b..3b1525cd592e 100644 --- a/circle.yml +++ b/circle.yml @@ -149,6 +149,7 @@ commands: command: | . ./scripts/load-nvm.sh yarn --prefer-offline --frozen-lockfile + no_output_timeout: 20m - run: node scripts/circle-cache.js --action prepare - save_cache: name: Saving node modules for root, cli, and all globbed workspace packages diff --git a/npm/vite-dev-server/cypress/plugins.js b/npm/vite-dev-server/cypress/plugins.js index 05b49d512860..9b1e592f9c98 100644 --- a/npm/vite-dev-server/cypress/plugins.js +++ b/npm/vite-dev-server/cypress/plugins.js @@ -1,11 +1,13 @@ -import { startDevServer } from '@cypress/vite-dev-server' -import viteConfig from '../vite.config' +const path = require('path') +const { startDevServer } = require('../dist') module.exports = (on, config) => { on('dev-server:start', async (options) => { return startDevServer({ options, - viteConfig, + viteConfig: { + configFile: path.resolve(__dirname, '..', 'vite.config.ts'), + }, }) }) diff --git a/npm/vite-dev-server/src/startServer.ts b/npm/vite-dev-server/src/startServer.ts index ad75828a4ef1..20f0d5efdbfc 100644 --- a/npm/vite-dev-server/src/startServer.ts +++ b/npm/vite-dev-server/src/startServer.ts @@ -14,10 +14,17 @@ interface Options { } export interface StartDevServer { - /* this is the Cypress options object */ + /** + * the Cypress options object + */ options: Options - /* support passing a path to the user's webpack config */ - viteConfig?: UserConfig // TODO: implement taking in the user's vite configuration. Right now we don't + /** + * By default, vite will use your vite.config file to + * Start the server. If you need additional plugins or + * to override some options, you can do so using this. + * @optional + */ + viteConfig?: UserConfig } const resolveServerConfig = async ({ viteConfig, options }: StartDevServer): Promise => { diff --git a/npm/vite-dev-server/vite.config.js b/npm/vite-dev-server/vite.config.ts similarity index 100% rename from npm/vite-dev-server/vite.config.js rename to npm/vite-dev-server/vite.config.ts diff --git a/npm/vue/examples/vue-cli/cypress/plugins.js b/npm/vue/examples/vue-cli/cypress/plugins.js index be6b4fed2c45..9a854bc9886d 100644 --- a/npm/vue/examples/vue-cli/cypress/plugins.js +++ b/npm/vue/examples/vue-cli/cypress/plugins.js @@ -7,9 +7,21 @@ const webpackConfig = require('@vue/cli-service/webpack.config') */ module.exports = (on, config) => { on('dev-server:start', (options) => { + // HtmlPwaPlugin is coupled to a hook in HtmlWebpackPlugin + // that was deprecated after 3.x. We currently only support + // HtmlWebpackPlugin 4.x and 5.x. + // TODO: Figure out how to deal with 2 major versions old HtmlWebpackPlugin + // which is still in widespread usage. + const modifiedWebpackConfig = { + ...webpackConfig, + plugins: (webpackConfig.plugins || []).filter((x) => { + return x.constructor.name !== 'HtmlPwaPlugin' + }), + } + return startDevServer({ options, - webpackConfig, + webpackConfig: modifiedWebpackConfig, }) }) diff --git a/npm/vue/examples/vue-cli/package.json b/npm/vue/examples/vue-cli/package.json index 7dd7f9a7616d..25fd8107282c 100644 --- a/npm/vue/examples/vue-cli/package.json +++ b/npm/vue/examples/vue-cli/package.json @@ -3,18 +3,20 @@ "version": "0.1.0", "private": true, "scripts": { - "build": "vue-cli-service build", "serve": "vue-cli-service serve", + "build": "vue-cli-service build", "cy:open": "node ../../../../scripts/cypress open-ct", "test": "node ../../../../scripts/cypress run-ct" }, "dependencies": { "core-js": "^3.6.5", + "register-service-worker": "^1.7.1", "vue": "^2.6.11" }, "devDependencies": { "@cypress/vue": "file:../../dist", "@vue/cli-plugin-babel": "~4.5.0", + "@vue/cli-plugin-pwa": "~4.5.0", "@vue/cli-service": "~4.5.0", "cypress-circleci-reporter": "0.2.0", "vue-template-compiler": "^2.6.11" diff --git a/npm/vue/examples/vue-cli/public/img/icons/android-chrome-192x192.png b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-192x192.png new file mode 100644 index 000000000000..b02aa64d9716 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-192x192.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/android-chrome-512x512.png b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-512x512.png new file mode 100644 index 000000000000..06088b011ecc Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-512x512.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-192x192.png b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-192x192.png new file mode 100644 index 000000000000..791e9c8c2c69 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-192x192.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-512x512.png b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-512x512.png new file mode 100644 index 000000000000..5f2098ed27e2 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/android-chrome-maskable-512x512.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-120x120.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-120x120.png new file mode 100644 index 000000000000..1427cf627526 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-120x120.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-152x152.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-152x152.png new file mode 100644 index 000000000000..f24d454a2ecb Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-152x152.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-180x180.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-180x180.png new file mode 100644 index 000000000000..404e192a95cc Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-180x180.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-60x60.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-60x60.png new file mode 100644 index 000000000000..cf10a5602e65 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-60x60.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-76x76.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-76x76.png new file mode 100644 index 000000000000..c500769e3df9 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon-76x76.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon.png b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon.png new file mode 100644 index 000000000000..03c0c5d5ec30 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/apple-touch-icon.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/favicon-16x16.png b/npm/vue/examples/vue-cli/public/img/icons/favicon-16x16.png new file mode 100644 index 000000000000..42af00963d81 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/favicon-16x16.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/favicon-32x32.png b/npm/vue/examples/vue-cli/public/img/icons/favicon-32x32.png new file mode 100644 index 000000000000..46ca04dee251 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/favicon-32x32.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/msapplication-icon-144x144.png b/npm/vue/examples/vue-cli/public/img/icons/msapplication-icon-144x144.png new file mode 100644 index 000000000000..7808237a18d4 Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/msapplication-icon-144x144.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/mstile-150x150.png b/npm/vue/examples/vue-cli/public/img/icons/mstile-150x150.png new file mode 100644 index 000000000000..3b37a43ae2fd Binary files /dev/null and b/npm/vue/examples/vue-cli/public/img/icons/mstile-150x150.png differ diff --git a/npm/vue/examples/vue-cli/public/img/icons/safari-pinned-tab.svg b/npm/vue/examples/vue-cli/public/img/icons/safari-pinned-tab.svg new file mode 100644 index 000000000000..e44c0d5b0ff3 --- /dev/null +++ b/npm/vue/examples/vue-cli/public/img/icons/safari-pinned-tab.svg @@ -0,0 +1,3 @@ + + + diff --git a/npm/vue/examples/vue-cli/public/robots.txt b/npm/vue/examples/vue-cli/public/robots.txt new file mode 100644 index 000000000000..eb0536286f30 --- /dev/null +++ b/npm/vue/examples/vue-cli/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/npm/vue/examples/vue-cli/src/main.js b/npm/vue/examples/vue-cli/src/main.js index dd079f8d5bd7..391b37a75f98 100644 --- a/npm/vue/examples/vue-cli/src/main.js +++ b/npm/vue/examples/vue-cli/src/main.js @@ -1,5 +1,6 @@ import Vue from 'vue' import App from './App.vue' +import './registerServiceWorker' Vue.config.productionTip = false diff --git a/npm/vue/examples/vue-cli/src/registerServiceWorker.js b/npm/vue/examples/vue-cli/src/registerServiceWorker.js new file mode 100644 index 000000000000..f2ad500957b4 --- /dev/null +++ b/npm/vue/examples/vue-cli/src/registerServiceWorker.js @@ -0,0 +1,32 @@ +/* eslint-disable no-console */ + +import { register } from 'register-service-worker' + +if (process.env.NODE_ENV === 'production') { + register(`${process.env.BASE_URL}service-worker.js`, { + ready () { + console.log( + 'App is being served from cache by a service worker.\n' + + 'For more details, visit https://goo.gl/AFskqB', + ) + }, + registered () { + console.log('Service worker has been registered.') + }, + cached () { + console.log('Content has been cached for offline use.') + }, + updatefound () { + console.log('New content is downloading.') + }, + updated () { + console.log('New content is available; please refresh.') + }, + offline () { + console.log('No internet connection found. App is running in offline mode.') + }, + error (error) { + console.error('Error during service worker registration:', error) + }, + }) +} diff --git a/npm/vue/examples/vue-cli/yarn.lock b/npm/vue/examples/vue-cli/yarn.lock index 68a751f03899..9188ca90ff49 100644 --- a/npm/vue/examples/vue-cli/yarn.lock +++ b/npm/vue/examples/vue-cli/yarn.lock @@ -827,7 +827,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/runtime@^7.11.0", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.11.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.8.4": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== @@ -884,7 +884,7 @@ resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== -"@hapi/joi@^15.0.1": +"@hapi/joi@^15.0.0", "@hapi/joi@^15.0.1": version "15.1.1" resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ== @@ -1276,6 +1276,15 @@ thread-loader "^2.1.3" webpack "^4.0.0" +"@vue/cli-plugin-pwa@~4.5.0": + version "4.5.12" + resolved "https://registry.yarnpkg.com/@vue/cli-plugin-pwa/-/cli-plugin-pwa-4.5.12.tgz#723ee4028e3086e910e7d357db39889203f30054" + integrity sha512-B8da8oHaBZHtt44skmwFRzYTqclyD4tk9JaZp9uV4J26fsz+hzbSbB1araUPkSP3eql4LBD1TTadvyY4jfo8jQ== + dependencies: + "@vue/cli-shared-utils" "^4.5.12" + webpack "^4.0.0" + workbox-webpack-plugin "^4.3.1" + "@vue/cli-plugin-router@^4.5.12": version "4.5.12" resolved "https://registry.yarnpkg.com/@vue/cli-plugin-router/-/cli-plugin-router-4.5.12.tgz#977c4b2b694cc03e9ef816112a5d58923493d0ac" @@ -1820,6 +1829,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +babel-extract-comments@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21" + integrity sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ== + dependencies: + babylon "^6.18.0" + babel-loader@^8.1.0: version "8.2.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" @@ -1861,6 +1877,32 @@ babel-plugin-polyfill-regenerator@^0.1.2: dependencies: "@babel/helper-define-polyfill-provider" "^0.1.5" +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= + +babel-plugin-transform-object-rest-spread@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -2527,6 +2569,11 @@ commander@~2.19.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== +common-tags@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" + integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -2666,6 +2713,11 @@ core-js-compat@^3.6.5, core-js-compat@^3.8.1, core-js-compat@^3.9.0: browserslist "^4.16.3" semver "7.0.0" +core-js@^2.4.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + core-js@^3.6.5: version "3.10.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.10.0.tgz#9a020547c8b6879f929306949e31496bbe2ae9b3" @@ -3703,6 +3755,15 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-extra@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -3771,6 +3832,11 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -4527,6 +4593,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + is-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" @@ -4576,6 +4647,11 @@ is-regex@^1.0.4, is-regex@^1.1.2: call-bind "^1.0.2" has-symbols "^1.0.1" +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -4740,6 +4816,13 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= + dependencies: + jsonify "~0.0.0" + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -4776,6 +4859,11 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -4883,6 +4971,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash._reinterpolate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -4908,6 +5001,21 @@ lodash.memoize@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= +lodash.template@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" + integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== + dependencies: + lodash._reinterpolate "^3.0.0" + lodash.transform@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.transform/-/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0" @@ -6200,6 +6308,11 @@ prettier@^1.18.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +pretty-bytes@^5.1.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" + integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== + pretty-error@^2.0.2: version "2.1.2" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6" @@ -6426,6 +6539,11 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + regenerator-runtime@^0.13.4: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -6466,6 +6584,11 @@ regexpu-core@^4.7.1: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.2.0" +register-service-worker@^1.7.1: + version "1.7.2" + resolved "https://registry.yarnpkg.com/register-service-worker/-/register-service-worker-1.7.2.tgz#6516983e1ef790a98c4225af1216bc80941a4bd2" + integrity sha512-CiD3ZSanZqcMPRhtfct5K9f7i3OLCcBBWsJjLh1gW9RO/nS94sVzY59iS+fgYBOBqaBpf4EzfqUF3j9IG+xo8A== + regjsgen@^0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" @@ -7144,6 +7267,15 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +stringify-object@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -7172,6 +7304,14 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-comments@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-1.0.2.tgz#82b9c45e7f05873bee53f37168af930aa368679d" + integrity sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw== + dependencies: + babel-extract-comments "^1.0.0" + babel-plugin-transform-object-rest-spread "^6.26.0" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -7928,6 +8068,141 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +workbox-background-sync@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-4.3.1.tgz#26821b9bf16e9e37fd1d640289edddc08afd1950" + integrity sha512-1uFkvU8JXi7L7fCHVBEEnc3asPpiAL33kO495UMcD5+arew9IbKW2rV5lpzhoWcm/qhGB89YfO4PmB/0hQwPRg== + dependencies: + workbox-core "^4.3.1" + +workbox-broadcast-update@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-broadcast-update/-/workbox-broadcast-update-4.3.1.tgz#e2c0280b149e3a504983b757606ad041f332c35b" + integrity sha512-MTSfgzIljpKLTBPROo4IpKjESD86pPFlZwlvVG32Kb70hW+aob4Jxpblud8EhNb1/L5m43DUM4q7C+W6eQMMbA== + dependencies: + workbox-core "^4.3.1" + +workbox-build@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-4.3.1.tgz#414f70fb4d6de47f6538608b80ec52412d233e64" + integrity sha512-UHdwrN3FrDvicM3AqJS/J07X0KXj67R8Cg0waq1MKEOqzo89ap6zh6LmaLnRAjpB+bDIz+7OlPye9iii9KBnxw== + dependencies: + "@babel/runtime" "^7.3.4" + "@hapi/joi" "^15.0.0" + common-tags "^1.8.0" + fs-extra "^4.0.2" + glob "^7.1.3" + lodash.template "^4.4.0" + pretty-bytes "^5.1.0" + stringify-object "^3.3.0" + strip-comments "^1.0.2" + workbox-background-sync "^4.3.1" + workbox-broadcast-update "^4.3.1" + workbox-cacheable-response "^4.3.1" + workbox-core "^4.3.1" + workbox-expiration "^4.3.1" + workbox-google-analytics "^4.3.1" + workbox-navigation-preload "^4.3.1" + workbox-precaching "^4.3.1" + workbox-range-requests "^4.3.1" + workbox-routing "^4.3.1" + workbox-strategies "^4.3.1" + workbox-streams "^4.3.1" + workbox-sw "^4.3.1" + workbox-window "^4.3.1" + +workbox-cacheable-response@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-4.3.1.tgz#f53e079179c095a3f19e5313b284975c91428c91" + integrity sha512-Rp5qlzm6z8IOvnQNkCdO9qrDgDpoPNguovs0H8C+wswLuPgSzSp9p2afb5maUt9R1uTIwOXrVQMmPfPypv+npw== + dependencies: + workbox-core "^4.3.1" + +workbox-core@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-4.3.1.tgz#005d2c6a06a171437afd6ca2904a5727ecd73be6" + integrity sha512-I3C9jlLmMKPxAC1t0ExCq+QoAMd0vAAHULEgRZ7kieCdUd919n53WC0AfvokHNwqRhGn+tIIj7vcb5duCjs2Kg== + +workbox-expiration@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-4.3.1.tgz#d790433562029e56837f341d7f553c4a78ebe921" + integrity sha512-vsJLhgQsQouv9m0rpbXubT5jw0jMQdjpkum0uT+d9tTwhXcEZks7qLfQ9dGSaufTD2eimxbUOJfWLbNQpIDMPw== + dependencies: + workbox-core "^4.3.1" + +workbox-google-analytics@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-4.3.1.tgz#9eda0183b103890b5c256e6f4ea15a1f1548519a" + integrity sha512-xzCjAoKuOb55CBSwQrbyWBKqp35yg1vw9ohIlU2wTy06ZrYfJ8rKochb1MSGlnoBfXGWss3UPzxR5QL5guIFdg== + dependencies: + workbox-background-sync "^4.3.1" + workbox-core "^4.3.1" + workbox-routing "^4.3.1" + workbox-strategies "^4.3.1" + +workbox-navigation-preload@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-4.3.1.tgz#29c8e4db5843803b34cd96dc155f9ebd9afa453d" + integrity sha512-K076n3oFHYp16/C+F8CwrRqD25GitA6Rkd6+qAmLmMv1QHPI2jfDwYqrytOfKfYq42bYtW8Pr21ejZX7GvALOw== + dependencies: + workbox-core "^4.3.1" + +workbox-precaching@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-4.3.1.tgz#9fc45ed122d94bbe1f0ea9584ff5940960771cba" + integrity sha512-piSg/2csPoIi/vPpp48t1q5JLYjMkmg5gsXBQkh/QYapCdVwwmKlU9mHdmy52KsDGIjVaqEUMFvEzn2LRaigqQ== + dependencies: + workbox-core "^4.3.1" + +workbox-range-requests@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-range-requests/-/workbox-range-requests-4.3.1.tgz#f8a470188922145cbf0c09a9a2d5e35645244e74" + integrity sha512-S+HhL9+iTFypJZ/yQSl/x2Bf5pWnbXdd3j57xnb0V60FW1LVn9LRZkPtneODklzYuFZv7qK6riZ5BNyc0R0jZA== + dependencies: + workbox-core "^4.3.1" + +workbox-routing@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-4.3.1.tgz#a675841af623e0bb0c67ce4ed8e724ac0bed0cda" + integrity sha512-FkbtrODA4Imsi0p7TW9u9MXuQ5P4pVs1sWHK4dJMMChVROsbEltuE79fBoIk/BCztvOJ7yUpErMKa4z3uQLX+g== + dependencies: + workbox-core "^4.3.1" + +workbox-strategies@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-4.3.1.tgz#d2be03c4ef214c115e1ab29c9c759c9fe3e9e646" + integrity sha512-F/+E57BmVG8dX6dCCopBlkDvvhg/zj6VDs0PigYwSN23L8hseSRwljrceU2WzTvk/+BSYICsWmRq5qHS2UYzhw== + dependencies: + workbox-core "^4.3.1" + +workbox-streams@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-streams/-/workbox-streams-4.3.1.tgz#0b57da70e982572de09c8742dd0cb40a6b7c2cc3" + integrity sha512-4Kisis1f/y0ihf4l3u/+ndMkJkIT4/6UOacU3A4BwZSAC9pQ9vSvJpIi/WFGQRH/uPXvuVjF5c2RfIPQFSS2uA== + dependencies: + workbox-core "^4.3.1" + +workbox-sw@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-4.3.1.tgz#df69e395c479ef4d14499372bcd84c0f5e246164" + integrity sha512-0jXdusCL2uC5gM3yYFT6QMBzKfBr2XTk0g5TPAV4y8IZDyVNDyj1a8uSXy3/XrvkVTmQvLN4O5k3JawGReXr9w== + +workbox-webpack-plugin@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-4.3.1.tgz#47ff5ea1cc074b6c40fb5a86108863a24120d4bd" + integrity sha512-gJ9jd8Mb8wHLbRz9ZvGN57IAmknOipD3W4XNE/Lk/4lqs5Htw4WOQgakQy/o/4CoXQlMCYldaqUg+EJ35l9MEQ== + dependencies: + "@babel/runtime" "^7.0.0" + json-stable-stringify "^1.0.1" + workbox-build "^4.3.1" + +workbox-window@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-4.3.1.tgz#ee6051bf10f06afa5483c9b8dfa0531994ede0f3" + integrity sha512-C5gWKh6I58w3GeSc0wp2Ne+rqVw8qwcmZnQGpjiek8A2wpbxSJb1FdCoQVO+jDJs35bFgo/WETgl1fqgsxN0Hg== + dependencies: + workbox-core "^4.3.1" + worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" diff --git a/npm/webpack-dev-server/src/startServer.ts b/npm/webpack-dev-server/src/startServer.ts index 2bb6b19d5060..7c9a54736e14 100644 --- a/npm/webpack-dev-server/src/startServer.ts +++ b/npm/webpack-dev-server/src/startServer.ts @@ -51,6 +51,7 @@ export async function start ({ webpackConfig: userWebpackConfig, options, ...use hot: false, inline: false, publicPath: devServerPublicPathRoute, + noInfo: true, } return new WebpackDevServer(compiler, webpackDevServerConfig) diff --git a/packages/driver/cypress/integration/commands/clock_spec.js b/packages/driver/cypress/integration/commands/clock_spec.js index bed3ef2ffeb7..44e369b385cc 100644 --- a/packages/driver/cypress/integration/commands/clock_spec.js +++ b/packages/driver/cypress/integration/commands/clock_spec.js @@ -20,11 +20,11 @@ describe('src/cy/commands/clock', () => { }) }) - it('proxies lolex clock, replacing window time methods', function (done) { + it('proxies @sinonjs/fake-timers clock, replacing window time methods', function (done) { expect(this.setTimeoutSpy).not.to.be.called cy.clock().then(function (clock) { - // lolex calls setTimeout once as part of its setup + // @sinonjs/fake-timers calls setTimeout once as part of its setup // but it shouldn't be called again by the @window.setTimeout() expect(this.setTimeoutSpy).to.be.calledOnce this.window.setTimeout(() => { @@ -113,7 +113,7 @@ describe('src/cy/commands/clock', () => { }) }) - // this test was written to catch a bug in lolex (dep) 3 and is fixed by lolex 4 upgrade, + // this test was written to catch a bug in lolex (dep, now @sinonjs/fake-timers) 3 and was fixed by lolex 4 upgrade, it('doesn\'t override window.performance members', () => { cy.clock() .then((clock) => { diff --git a/packages/driver/package.json b/packages/driver/package.json index 37d91ae77eae..f4c885afcc04 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -21,6 +21,7 @@ "@packages/runner": "0.0.0-development", "@packages/server": "0.0.0-development", "@packages/ts": "0.0.0-development", + "@sinonjs/fake-timers": "7.0.2", "@types/chalk": "^2.2.0", "@types/common-tags": "^1.8.0", "@types/lodash": "^4.14.168", @@ -52,7 +53,6 @@ "js-cookie": "2.2.1", "jsdom": "14.1.0", "lodash": "4.17.19", - "lolex": "4.1.0", "md5": "2.3.0", "method-override": "3.0.0", "methods": "1.1.2", diff --git a/packages/driver/src/cypress.js b/packages/driver/src/cypress.js index 7b90a927d109..d29cd9f27d16 100644 --- a/packages/driver/src/cypress.js +++ b/packages/driver/src/cypress.js @@ -4,7 +4,7 @@ const blobUtil = require('blob-util') const minimatch = require('minimatch') const Promise = require('bluebird') const sinon = require('sinon') -const lolex = require('lolex') +const fakeTimers = require('@sinonjs/fake-timers') const $dom = require('./dom') const $errorMessages = require('./cypress/error_messages') @@ -630,7 +630,7 @@ $Cypress.prototype.Blob = blobUtil $Cypress.prototype.Promise = Promise $Cypress.prototype.minimatch = minimatch $Cypress.prototype.sinon = sinon -$Cypress.prototype.lolex = lolex +$Cypress.prototype.lolex = fakeTimers // attaching these so they are accessible // via the runner + integration spec helper diff --git a/packages/driver/src/cypress/clock.js b/packages/driver/src/cypress/clock.js index 6aede75ec96b..799c5610df14 100644 --- a/packages/driver/src/cypress/clock.js +++ b/packages/driver/src/cypress/clock.js @@ -1,9 +1,8 @@ const _ = require('lodash') -const lolex = require('lolex') +const fakeTimers = require('@sinonjs/fake-timers') const install = (win, now, methods) => { - return lolex.withGlobal(win).install({ - target: win, + return fakeTimers.withGlobal(win).install({ now, toFake: methods, }) @@ -23,7 +22,7 @@ const create = (win, now, methods) => { // reset the hadOwnProperty in case a // the application code eradicated the // overridden clock method at a later time. - // this is a property that lolex using internally + // this is a property that @sinonjs/fake-timers using internally // when restoring the global methods. // https://github.com/cypress-io/cypress/issues/2850 const fn = clock[method] diff --git a/packages/server-ct/src/socket-ct.ts b/packages/server-ct/src/socket-ct.ts index 938fa3a3d4a5..084d964776e1 100644 --- a/packages/server-ct/src/socket-ct.ts +++ b/packages/server-ct/src/socket-ct.ts @@ -1,8 +1,11 @@ +import Debug from 'debug' import * as socketIo from '@packages/socket' import devServer from '@packages/server/lib/plugins/dev-server' import { SocketBase } from '@packages/server/lib/socket-base' import { DestroyableHttpServer } from '@packages/server/lib/util/server_destroy' +const debug = Debug('cypress:server-ct:socket-ct') + export class SocketCt extends SocketBase { constructor (config: Record) { super(config) @@ -26,7 +29,7 @@ export class SocketCt extends SocketBase { return super.startListening(server, automation, config, options, { onSocketConnection (socket: socketIo.SocketIOServer) { - + debug('do onSocketConnection') }, }) } diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index 0dc4ab4914bb..8db422e4ecd8 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -1049,9 +1049,7 @@ module.exports = { * in the same browser */ writeVideoFrameCallback () { - if (this.currentWriteVideoFrameCallback) { - return this.currentWriteVideoFrameCallback(...arguments) - } + return this.currentWriteVideoFrameCallback(...arguments) }, waitForBrowserToConnect (options = {}, shouldLaunchBrowser = true) { @@ -1061,8 +1059,10 @@ module.exports = { // short circuit current browser callback so that we // can rewire it without relaunching the browser - this.currentWriteVideoFrameCallback = writeVideoFrame - options.writeVideoFrame = this.writeVideoFrameCallback.bind(this) + if (writeVideoFrame) { + this.currentWriteVideoFrameCallback = writeVideoFrame + options.writeVideoFrame = this.writeVideoFrameCallback.bind(this) + } // without this the run mode is only setting new spec // path for next spec in launch browser. diff --git a/packages/server/lib/project-base.ts b/packages/server/lib/project-base.ts index 549d1de4ac01..528107aebda3 100644 --- a/packages/server/lib/project-base.ts +++ b/packages/server/lib/project-base.ts @@ -48,6 +48,7 @@ export type Cfg = Record const localCwd = cwd() const multipleForwardSlashesRe = /[^:\/\/](\/{2,})/g +const backSlashesRe = /\\/g const debug = Debug('cypress:server:project') const debugScaffold = Debug('cypress:server:scaffold') @@ -373,6 +374,7 @@ export class ProjectBase extends EE { }, onConnect: (id) => { + debug('socket:connected') this.emit('socket:connected', id) }, @@ -574,10 +576,14 @@ export class ProjectBase extends EE { const folderToUse = type === 'integration' ? integrationFolder : componentFolder + // To avoid having invalid urls from containing backslashes, + // we normalize specUrls to posix by replacing backslash by slash + // Indeed, path.realtive will return something different on windows + // than on posix systems which can lead to problems const url = `/${path.join(type, path.relative( folderToUse, path.resolve(projectRoot, pathToSpec), - ))}` + )).replace(backSlashesRe, '/')}` debug('prefixed path for spec %o', { pathToSpec, type, url }) @@ -591,7 +597,8 @@ export class ProjectBase extends EE { browserUrl, '#/tests', escapeFilenameInUrl(specUrl), - ].join('/').replace(multipleForwardSlashesRe, replacer) + ].join('/') + .replace(multipleForwardSlashesRe, replacer) } scaffold (cfg: Cfg) { diff --git a/packages/server/lib/server-e2e.ts b/packages/server/lib/server-e2e.ts index 913175cf0194..0ff2f75d4e1d 100644 --- a/packages/server/lib/server-e2e.ts +++ b/packages/server/lib/server-e2e.ts @@ -109,6 +109,8 @@ export class ServerE2E extends ServerBase { } } + debug('createServer connecting to server') + this.server.on('connect', this.onConnect.bind(this)) this.server.on('upgrade', (req, socket, head) => this.onUpgrade(req, socket, head, socketIoRoute)) this.server.once('error', onError) diff --git a/packages/server/package.json b/packages/server/package.json index 9b0459352fba..f9be62f22095 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -31,7 +31,7 @@ "@cypress/webpack-batteries-included-preprocessor": "0.0.0-development", "@cypress/webpack-preprocessor": "0.0.0-development", "@ffmpeg-installer/ffmpeg": "1.0.20", - "ansi_up": "4.0.4", + "ansi_up": "5.0.0", "ast-types": "0.13.3", "black-hole-stream": "0.0.1", "bluebird": "3.7.2", diff --git a/packages/server/test/e2e/7_record_spec.js b/packages/server/test/e2e/7_record_spec.js index 16f4ea31aad9..b2efaa9e4fa7 100644 --- a/packages/server/test/e2e/7_record_spec.js +++ b/packages/server/test/e2e/7_record_spec.js @@ -66,8 +66,8 @@ describe('e2e record', () => { `POST /runs/${runId}/instances`, `POST /instances/${instanceId}/tests`, `POST /instances/${instanceId}/results`, - 'PUT /screenshots/1.png', 'PUT /videos/video.mp4', + 'PUT /screenshots/1.png', `PUT /instances/${instanceId}/stdout`, // spec 3 @@ -82,8 +82,8 @@ describe('e2e record', () => { `POST /runs/${runId}/instances`, `POST /instances/${instanceId}/tests`, `POST /instances/${instanceId}/results`, - 'PUT /screenshots/1.png', 'PUT /videos/video.mp4', + 'PUT /screenshots/1.png', `PUT /instances/${instanceId}/stdout`, ]) diff --git a/packages/server/test/support/helpers/serverStub.ts b/packages/server/test/support/helpers/serverStub.ts index d0e5474c0143..f5dd180bf5f8 100644 --- a/packages/server/test/support/helpers/serverStub.ts +++ b/packages/server/test/support/helpers/serverStub.ts @@ -111,17 +111,17 @@ const routeHandlers = { method: 'put', url: '/videos/:name', res (req, res) { - return Bluebird.delay(200) - .then(() => { - return res.sendStatus(200) - }) + return res.sendStatus(200) }, }, putScreenshots: { method: 'put', url: '/screenshots/:name', res (req, res) { - return res.sendStatus(200) + return Bluebird.delay(300) + .then(() => { + return res.sendStatus(200) + }) }, }, diff --git a/packages/server/test/unit/modes/run_spec.js b/packages/server/test/unit/modes/run_spec.js index 8cbaf75bbb32..382c391bca01 100644 --- a/packages/server/test/unit/modes/run_spec.js +++ b/packages/server/test/unit/modes/run_spec.js @@ -276,6 +276,7 @@ describe('lib/modes/run', () => { .then(() => { expect(openProject.closeBrowser).to.be.calledThrice expect(runMode.launchBrowser).to.be.calledThrice + expect(runMode.launchBrowser.firstCall.args[0]).not.property('writeVideoFrame') expect(errors.warning).to.be.calledWith('TESTS_DID_NOT_START_RETRYING', 'Retrying...') expect(errors.warning).to.be.calledWith('TESTS_DID_NOT_START_RETRYING', 'Retrying again...') expect(errors.get).to.be.calledWith('TESTS_DID_NOT_START_FAILED') diff --git a/yarn.lock b/yarn.lock index 563f063cd942..66d9e7b95dd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6532,6 +6532,13 @@ dependencies: type-detect "4.0.8" +"@sinonjs/fake-timers@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.0.2.tgz#a53e71d4154ee704ea9b36a6d0b0780e246fadd1" + integrity sha512-dF84L5YC90gIOegPDCYymPIsDmwMWWSh7BwfDXQYePi8lVIEp7IZ1UVGkME8FjXOsDPxan12x4aaK+Lo6wVh9A== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@sinonjs/fake-timers@^6.0.0", "@sinonjs/fake-timers@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40" @@ -9789,10 +9796,10 @@ ansi-wrap@0.1.0, ansi-wrap@^0.1.0: resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= -ansi_up@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/ansi_up/-/ansi_up-4.0.4.tgz#5b8c35f0b02e4476f3f18cf89c3bf48d15d054f6" - integrity sha512-vRxC8q6QY918MbehO869biJW4tiunJdjOhi5fpY6NLOliBQlZhOkKgABJKJqH+JZfb/WfjvjN1chLWI6tODerw== +ansi_up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi_up/-/ansi_up-5.0.0.tgz#9bc3b087a59bd543c98dd235a9c8e0a842c454e9" + integrity sha512-RHw/w3Kb2U3k4XKfl8FXZW9ldxtTBbLNdKO0RboYeU4ReVwRP77M7b/OxiavMGZsBWcDxn/T0QiR+VtLf7mPYw== ansicolors@~0.3.2: version "0.3.2" @@ -25987,11 +25994,6 @@ lolex@1.3.2: resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31" integrity sha1-fD2mL/yzDw9agKJWbKJORdigHzE= -lolex@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-4.1.0.tgz#ecdd7b86539391d8237947a3419aa8ac975f0fe1" - integrity sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw== - lolex@^2.4.2: version "2.7.5" resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733"