Skip to content

Commit

Permalink
test: update dev-server types and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 committed Jun 13, 2022
1 parent b924d08 commit 868081a
Show file tree
Hide file tree
Showing 10 changed files with 1,170 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5500,7 +5500,7 @@ declare namespace Cypress {

interface DevServerConfig {
specs: Spec[]
config: ResolvedConfigOptions & RuntimeConfigOptions
cypressConfig: PluginConfigOptions
devServerEvents: NodeJS.EventEmitter
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'cypress'
import defaultConfig from './cypress-vite.config'
import {devServer as cypressViteDevServer} from '@cypress/vite-dev-server'

export default defineConfig({
...defaultConfig,
component: {
devServer: (devServerOptions) => cypressViteDevServer({
...devServerOptions,
framework: 'react'
})
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default defineConfig({
framework: 'react',
bundler: 'vite',
viteConfig: {
logLevel: 'silent',
server: {
port: 3000
}
Expand Down
3 changes: 0 additions & 3 deletions system-tests/project-fixtures/react/cypress-vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export default defineConfig({
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: {
logLevel: 'silent'
},
},
},
// These tests should run quickly / fail quickly,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'cypress'
import defaultConfig from './cypress-webpack.config'
import { devServer as cypressWebpackDevServer } from '@cypress/webpack-dev-server'

export default defineConfig({
...defaultConfig,
component: {
devServer: (devServerOptions) => cypressWebpackDevServer({
...devServerOptions,
framework: 'react',
}),
supportFile: false
}
})
5 changes: 5 additions & 0 deletions system-tests/project-fixtures/react/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const {defineConfig} = require('vite')

module.exports = defineConfig({
logLevel: 'silent'
})
1 change: 1 addition & 0 deletions system-tests/projects/vite2.9.1-react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"devDependencies": {
"@cypress/vite-dev-server": "file:../../../npm/vite-dev-server",
"react": "^17.0.0",
"vite": "2.9.1"
},
Expand Down
63 changes: 63 additions & 0 deletions system-tests/projects/vite2.9.1-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
# yarn lockfile v1


"@cypress/vite-dev-server@file:../../../npm/vite-dev-server":
version "0.0.0-development"
dependencies:
debug "4.3.3"
find-up "5.0.0"
pathe "0.2.0"

debug@4.3.3:
version "4.3.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
dependencies:
ms "2.1.2"

esbuild-android-64@0.14.31:
version "0.14.31"
resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.31.tgz#4b7dfbbeee62b3495ba78220b85fb590eb68d5bf"
Expand Down Expand Up @@ -128,6 +142,14 @@ esbuild@^0.14.27:
esbuild-windows-64 "0.14.31"
esbuild-windows-arm64 "0.14.31"

find-up@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
dependencies:
locate-path "^6.0.0"
path-exists "^4.0.0"

fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
Expand Down Expand Up @@ -157,13 +179,25 @@ is-core-module@^2.8.1:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity "sha1-GSA/tZmR35jjoocFDUZHzerzJJk= sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="

locate-path@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
dependencies:
p-locate "^5.0.0"

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8= sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

nanoid@^3.3.1:
version "3.3.2"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.2.tgz#c89622fafb4381cd221421c69ec58547a1eec557"
Expand All @@ -174,11 +208,35 @@ object-assign@^4.1.1:
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="

p-limit@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
dependencies:
yocto-queue "^0.1.0"

p-locate@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
dependencies:
p-limit "^3.0.2"

path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==

path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity "sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU= sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="

pathe@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/pathe/-/pathe-0.2.0.tgz#30fd7bbe0a0d91f0e60bae621f5d19e9e225c339"
integrity sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==

picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
Expand Down Expand Up @@ -238,3 +296,8 @@ vite@2.9.1:
rollup "^2.59.0"
optionalDependencies:
fsevents "~2.3.2"

yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
1 change: 1 addition & 0 deletions system-tests/projects/webpack5_wds4-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7",
"@babel/preset-react": "^7",
"@cypress/webpack-dev-server": "file:../../../npm/webpack-dev-server",
"babel-loader": "^8.2.4",
"webpack": "^5",
"webpack-dev-server": "^4"
Expand Down
Loading

0 comments on commit 868081a

Please sign in to comment.