Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: moving over many vue + vite system tests to use object API instead of function API #21080

Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('Launchpad: Error System Tests', () => {
cy.get('h1').should('contain', 'Error Loading Config')
cy.percySnapshot()

cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.js:4:23')
cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.js:3:23')
})

it('shows correct stack trace when config with ts-module error', () => {
Expand Down
18 changes: 17 additions & 1 deletion packages/scaffold-config/src/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ interface CreateCypressConfig {
}

export function createCypressConfig (config: CreateCypressConfig): string {
const isDefineConfigAvailable = defineConfigAvailable(config.projectRoot)

if (config.language === 'ts') {
if (defineConfigAvailable(config.projectRoot)) {
if (isDefineConfigAvailable) {
return dedent`
import { defineConfig } from 'cypress'

Expand All @@ -91,6 +93,20 @@ export function createCypressConfig (config: CreateCypressConfig): string {
}`
}

if (isDefineConfigAvailable) {
return dedent`
const { defineConfig } = require('cypress')

module.exports = defineConfig({
component: {
devServer: {
framework: '${config.framework}',
bundler: '${config.bundler}'
}
}
})`
}

return dedent`
module.exports = {
component: {
Expand Down
17 changes: 6 additions & 11 deletions system-tests/projects/component-tests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
const { devServer } = require('@cypress/webpack-dev-server')
const { defineConfig } = require('cypress')

module.exports = {
'projectId': 'abc123',
module.exports = defineConfig({
projectId: 'abc123',
e2e: {
specPattern: 'cypress/e2e/**/*',
},
component: {
specPattern: 'cypress/component-tests/**/*',
devServer,
devServerConfig: {
webpackConfig: {
output: {
publicPath: '/',
},
},
devServer: {
bundler: 'webpack',
},
setupNodeEvents (on, config) {
require('@cypress/code-coverage/task')(on, config)

return config
},
},
}
})
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
const { devServer } = require('@cypress/webpack-dev-server')
const { defineConfig } = require('cypress')

module.exports = {
'projectId': 'abcdef42',
module.exports = defineConfig({
projectId: 'abcdef42',
e2e: {
specPattern: 'cypress/e2e/**/*',
},
component: {
specPattern: 'cypress/component-tests/**/*',
devServer,
devServerConfig: {
webpackConfig: {
output: {
publicPath: '/',
},
},
devServer: {
bundler: 'webpack',
},
setupNodeEvents (on, config) {
require('@cypress/code-coverage/task')(on, config)

return config
},
},
}
})
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
const { devServer } = require('@cypress/webpack-dev-server')
const { defineConfig } = require('cypress')

module.exports = {
module.exports = defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*',
},
component: {
specPattern: 'cypress/component-tests/**/*',
devServer,
devServerConfig: {
webpackConfig: {
output: {
publicPath: '/',
},
},
devServer: {
bundler: 'webpack',
},
setupNodeEvents (on, config) {
require('@cypress/code-coverage/task')(on, config)

return config
},
},
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,107 +5,107 @@
esbuild-android-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz#d532d38cb5fe0ae45167ce35f4bbc784c636be40"
integrity sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==
integrity "sha1-1TLTjLX+CuRRZ8419LvHhMY2vkA= sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ=="

esbuild-android-arm64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz#9c5bb3366aabfd14a1c726d36978b79441dfcb6e"
integrity sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==
integrity "sha1-nFuzNmqr/RShxybTaXi3lEHfy24= sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw=="

esbuild-darwin-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz#05dcdb6d884f427039ffee5e92ff97527e56c26d"
integrity sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==
integrity "sha1-BdzbbYhPQnA5/+5ekv+XUn5Wwm0= sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA=="

esbuild-darwin-arm64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz#28e080da4ea0cfe9498071e7f8060498caee1a95"
integrity sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==
integrity "sha1-KOCA2k6gz+lJgHHn+AYEmMruGpU= sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw=="

esbuild-freebsd-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz#200d3664a3b945bc9fdcba73614b49a11ebd1cfa"
integrity sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==
integrity "sha1-IA02ZKO5Rbyf3LpzYUtJoR69HPo= sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ=="

esbuild-freebsd-arm64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz#624b08c5da6013bdc312aaa23c4ff409580f5c3c"
integrity sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==
integrity "sha1-YksIxdpgE73DEqqiPE/0CVgPXDw= sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug=="

esbuild-linux-32@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz#0238e597eb0b60aa06c7e98fccbbfd6bb9a0d6c5"
integrity sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==
integrity "sha1-Ajjll+sLYKoGx+mPzLv9a7mg1sU= sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw=="

esbuild-linux-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz#8a8b8cf47dfce127c858e71229d9a385a82c62e8"
integrity sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==
integrity "sha1-iouM9H384SfIWOcSKdmjhagsYug= sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug=="

esbuild-linux-arm64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz#7ac94371418a2640ba413bc1700aaedeb2794e52"
integrity sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==
integrity "sha1-eslDcUGKJkC6QTvBcAqu3rJ5TlI= sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw=="

esbuild-linux-arm@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz#034bd18e9310b9f010c89f90ef7f05706689600b"
integrity sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==
integrity "sha1-A0vRjpMQufAQyJ+Q738FcGaJYAs= sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw=="

esbuild-linux-mips64le@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz#05f98a8cf6b578eab6b4e6b0ab094f37530934f4"
integrity sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==
integrity "sha1-BfmKjPa1eOq2tOawqwlPN1MJNPQ= sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ=="

esbuild-linux-ppc64le@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz#46fd0add8d8535678439d7a9c2876ad20042d952"
integrity sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==
integrity "sha1-Rv0K3Y2FNWeEOdepwodq0gBC2VI= sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw=="

esbuild-linux-riscv64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz#ea2e986f0f3e5df73c635135dd778051734fc605"
integrity sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==
integrity "sha1-6i6Ybw8+Xfc8Y1E13XeAUXNPxgU= sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w=="

esbuild-linux-s390x@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz#efe89486e9a1b1508925048076e3f3a6698aa6a3"
integrity sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==
integrity "sha1-7+iUhumhsVCJJQSAduPzpmmKpqM= sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ=="

esbuild-netbsd-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz#439fe27d8ee3b5887501ee63988e85f920107db6"
integrity sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==
integrity "sha1-Q5/ifY7jtYh1Ae5jmI6F+SAQfbY= sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA=="

esbuild-openbsd-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz#31ebf616aadf6e60674469f2b92cec92280d9930"
integrity sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==
integrity "sha1-Mev2FqrfbmBnRGnyuSzskigNmTA= sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A=="

esbuild-sunos-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz#815e4f936d74970292a63ccfd5791fe5e3569f5f"
integrity sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==
integrity "sha1-gV5Pk210lwKSpjzP1Xkf5eNWn18= sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw=="

esbuild-windows-32@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz#189e14df2478f2c193c86968ab1fb54e1ceaafd2"
integrity sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==
integrity "sha1-GJ4U3yR48sGTyGloqx+1Thzqr9I= sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA=="

esbuild-windows-64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz#3d5fbfdc3856850bb47439299e3b60dd18be111f"
integrity sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==
integrity "sha1-PV+/3DhWhQu0dDkpnjtg3Ri+ER8= sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA=="

esbuild-windows-arm64@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz#8b243cbbad8a86cf98697da9ccb88c05df2ef458"
integrity sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==
integrity "sha1-iyQ8u62Khs+YaX2pzLiMBd8u9Fg= sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA=="

esbuild@0.14.25:
version "0.14.25"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.25.tgz#ddb9d47b91ca76abb7d850ce3dfed0bc3dc88d16"
integrity sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==
integrity "sha1-3bnUe5HKdqu32FDOPf7QvD3IjRY= sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q=="
optionalDependencies:
esbuild-android-64 "0.14.25"
esbuild-android-arm64 "0.14.25"
Expand Down
Loading