From e486da08810dacd6ff483e44c239f63ccca9e525 Mon Sep 17 00:00:00 2001 From: itsMapleLeaf <19603573+itsMapleLeaf@users.noreply.github.com> Date: Sat, 23 Jul 2022 13:53:55 -0500 Subject: [PATCH] migrate to cypress 10 --- packages/website/cypress.config.ts | 8 ++++++ packages/website/cypress.json | 3 --- .../mobile-popover-menu.cy.ts} | 0 .../website/cypress/fixtures/example.json | 5 ---- packages/website/cypress/plugins/index.js | 22 ---------------- packages/website/cypress/support/commands.js | 26 ------------------- packages/website/cypress/support/commands.ts | 1 + packages/website/cypress/support/e2e.ts | 1 + packages/website/cypress/support/index.js | 20 -------------- packages/website/tsconfig.json | 3 ++- 10 files changed, 12 insertions(+), 77 deletions(-) create mode 100644 packages/website/cypress.config.ts delete mode 100644 packages/website/cypress.json rename packages/website/cypress/{integration/mobile-popover-menu.test.ts => e2e/mobile-popover-menu.cy.ts} (100%) delete mode 100644 packages/website/cypress/fixtures/example.json delete mode 100644 packages/website/cypress/plugins/index.js delete mode 100644 packages/website/cypress/support/commands.js create mode 100644 packages/website/cypress/support/commands.ts create mode 100644 packages/website/cypress/support/e2e.ts delete mode 100644 packages/website/cypress/support/index.js diff --git a/packages/website/cypress.config.ts b/packages/website/cypress.config.ts new file mode 100644 index 0000000..0166083 --- /dev/null +++ b/packages/website/cypress.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "cypress" + +export default defineConfig({ + e2e: { + setupNodeEvents(on, config) {}, + baseUrl: "http://localhost:3000/", + }, +}) diff --git a/packages/website/cypress.json b/packages/website/cypress.json deleted file mode 100644 index 04cd00e..0000000 --- a/packages/website/cypress.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "baseUrl": "http://localhost:3000/" -} diff --git a/packages/website/cypress/integration/mobile-popover-menu.test.ts b/packages/website/cypress/e2e/mobile-popover-menu.cy.ts similarity index 100% rename from packages/website/cypress/integration/mobile-popover-menu.test.ts rename to packages/website/cypress/e2e/mobile-popover-menu.cy.ts diff --git a/packages/website/cypress/fixtures/example.json b/packages/website/cypress/fixtures/example.json deleted file mode 100644 index 02e4254..0000000 --- a/packages/website/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/packages/website/cypress/plugins/index.js b/packages/website/cypress/plugins/index.js deleted file mode 100644 index 517e605..0000000 --- a/packages/website/cypress/plugins/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/// -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ -// eslint-disable-next-line no-unused-vars -export default function cypressConfig(on, config) { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/packages/website/cypress/support/commands.js b/packages/website/cypress/support/commands.js deleted file mode 100644 index 8b388c6..0000000 --- a/packages/website/cypress/support/commands.js +++ /dev/null @@ -1,26 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -import "@testing-library/cypress/add-commands" diff --git a/packages/website/cypress/support/commands.ts b/packages/website/cypress/support/commands.ts new file mode 100644 index 0000000..6034b0d --- /dev/null +++ b/packages/website/cypress/support/commands.ts @@ -0,0 +1 @@ +import "@testing-library/cypress/add-commands" diff --git a/packages/website/cypress/support/e2e.ts b/packages/website/cypress/support/e2e.ts new file mode 100644 index 0000000..b7cb303 --- /dev/null +++ b/packages/website/cypress/support/e2e.ts @@ -0,0 +1 @@ +import "./commands" diff --git a/packages/website/cypress/support/index.js b/packages/website/cypress/support/index.js deleted file mode 100644 index a80764c..0000000 --- a/packages/website/cypress/support/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import "./commands" - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index a284a6e..158d789 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -6,5 +6,6 @@ "paths": { "~/*": ["./app/*"] } - } + }, + "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"] }