From 9c35965a7e9bacd38160786e42c652f87fdb3c00 Mon Sep 17 00:00:00 2001 From: mutoe Date: Thu, 9 Jun 2022 20:51:40 +0800 Subject: [PATCH] chore: upgrade cypress 10 --- cypress.config.ts | 14 ++++++++++++++ cypress.json | 4 ---- cypress.prod.config.ts | 7 +++++++ cypress.prod.json | 6 ------ cypress/{integration => e2e}/article.test.js | 0 cypress/{integration => e2e}/auth.test.js | 0 cypress/{integration => e2e}/favorite.test.js | 0 cypress/{integration => e2e}/follow.test.js | 0 cypress/{integration => e2e}/home.test.js | 0 cypress/{integration => e2e}/tag.test.js | 0 cypress/support/{index.js => e2e.js} | 0 package.json | 6 +++--- 12 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 cypress.config.ts delete mode 100644 cypress.json create mode 100644 cypress.prod.config.ts delete mode 100644 cypress.prod.json rename cypress/{integration => e2e}/article.test.js (100%) rename cypress/{integration => e2e}/auth.test.js (100%) rename cypress/{integration => e2e}/favorite.test.js (100%) rename cypress/{integration => e2e}/follow.test.js (100%) rename cypress/{integration => e2e}/home.test.js (100%) rename cypress/{integration => e2e}/tag.test.js (100%) rename cypress/support/{index.js => e2e.js} (100%) diff --git a/cypress.config.ts b/cypress.config.ts new file mode 100644 index 0000000..53f1b06 --- /dev/null +++ b/cypress.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'cypress' + +export default defineConfig({ + projectId: 'j7s91r', + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require('./cypress/plugins/index.js')(on, config) + }, + baseUrl: 'http://localhost:4173', + specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', + }, +}) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index fe61731..0000000 --- a/cypress.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "projectId": "j7s91r", - "baseUrl": "http://localhost:3000" -} diff --git a/cypress.prod.config.ts b/cypress.prod.config.ts new file mode 100644 index 0000000..a12a3d8 --- /dev/null +++ b/cypress.prod.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'cypress' + +export default defineConfig({ + chromeWebSecurity: false, + defaultCommandTimeout: 8000, + requestTimeout: 8000, +}) diff --git a/cypress.prod.json b/cypress.prod.json deleted file mode 100644 index 30b7a2a..0000000 --- a/cypress.prod.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "baseUrl": "https://mutoe.github.io/vue3-realworld-example-app", - "chromeWebSecurity": false, - "defaultCommandTimeout": 8000, - "requestTimeout": 8000 -} diff --git a/cypress/integration/article.test.js b/cypress/e2e/article.test.js similarity index 100% rename from cypress/integration/article.test.js rename to cypress/e2e/article.test.js diff --git a/cypress/integration/auth.test.js b/cypress/e2e/auth.test.js similarity index 100% rename from cypress/integration/auth.test.js rename to cypress/e2e/auth.test.js diff --git a/cypress/integration/favorite.test.js b/cypress/e2e/favorite.test.js similarity index 100% rename from cypress/integration/favorite.test.js rename to cypress/e2e/favorite.test.js diff --git a/cypress/integration/follow.test.js b/cypress/e2e/follow.test.js similarity index 100% rename from cypress/integration/follow.test.js rename to cypress/e2e/follow.test.js diff --git a/cypress/integration/home.test.js b/cypress/e2e/home.test.js similarity index 100% rename from cypress/integration/home.test.js rename to cypress/e2e/home.test.js diff --git a/cypress/integration/tag.test.js b/cypress/e2e/tag.test.js similarity index 100% rename from cypress/integration/tag.test.js rename to cypress/e2e/tag.test.js diff --git a/cypress/support/index.js b/cypress/support/e2e.js similarity index 100% rename from cypress/support/index.js rename to cypress/support/e2e.js diff --git a/package.json b/package.json index f347dc1..ff0851b 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "prepare": "husky install", "dev": "vite", "build": "vite build", - "serve": "vite preview", + "serve": "vite preview --port 4137", "lint:script": "eslint \"{src/**/*.{ts,vue},cypress/**/*.js}\"", "lint:tsc": "vue-tsc --noEmit", "lint": "concurrently \"yarn build\" \"yarn lint:tsc\" \"yarn lint:script\"", "test:unit": "jest", - "test:e2e": "yarn build && concurrently -rk -s first \"yarn serve\" \"cypress run -c baseUrl=http://localhost:5000\"", - "test:e2e:ci": "cypress run -C cypress.prod.json", + "test:e2e": "yarn build && concurrently -rk -s first \"yarn serve\" \"./node_modules/.bin/cypress run -c baseUrl=http://localhost:4137\"", + "test:e2e:ci": "./node_modules/.bin/cypress run -C cypress.prod.json", "test": "yarn test:unit && yarn test:e2e" }, "dependencies": {