From 751b43eef444122451dc542bb73c66ef91cd2f6b Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 29 May 2021 13:48:01 +0530 Subject: [PATCH] Typescript Tests --- .../{actions.spec.js => actions.spec.ts} | 0 ...{diagramUpdate.spec.js => diagramUpdate.spec.ts} | 0 .../{history.spec.js => history.spec.ts} | 0 .../{loadSite.spec.js => loadSite.spec.ts} | 0 cypress/support/{commands.js => commands.ts} | 13 +++++++++++-- cypress/tsconfig.json | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) rename cypress/integration/{actions.spec.js => actions.spec.ts} (100%) rename cypress/integration/{diagramUpdate.spec.js => diagramUpdate.spec.ts} (100%) rename cypress/integration/{history.spec.js => history.spec.ts} (100%) rename cypress/integration/{loadSite.spec.js => loadSite.spec.ts} (100%) rename cypress/support/{commands.js => commands.ts} (80%) diff --git a/cypress/integration/actions.spec.js b/cypress/integration/actions.spec.ts similarity index 100% rename from cypress/integration/actions.spec.js rename to cypress/integration/actions.spec.ts diff --git a/cypress/integration/diagramUpdate.spec.js b/cypress/integration/diagramUpdate.spec.ts similarity index 100% rename from cypress/integration/diagramUpdate.spec.js rename to cypress/integration/diagramUpdate.spec.ts diff --git a/cypress/integration/history.spec.js b/cypress/integration/history.spec.ts similarity index 100% rename from cypress/integration/history.spec.js rename to cypress/integration/history.spec.ts diff --git a/cypress/integration/loadSite.spec.js b/cypress/integration/loadSite.spec.ts similarity index 100% rename from cypress/integration/loadSite.spec.js rename to cypress/integration/loadSite.spec.ts diff --git a/cypress/support/commands.js b/cypress/support/commands.ts similarity index 80% rename from cypress/support/commands.js rename to cypress/support/commands.ts index fe152463..c80aaf8d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.ts @@ -23,6 +23,15 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -import * as snapshot from '@cypress/snapshot'; -snapshot.register(); +import { register } from '@cypress/snapshot'; +register(); +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Cypress { + interface Chainable { + snapshot(): void; + } + } +} + import 'cypress-localstorage-commands'; diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 3398fd57..77501744 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -3,5 +3,5 @@ "allowJs": true, "types": ["cypress", "cypress-localstorage-commands"] }, - "include": ["**/*.*"] + "include": ["**/*.ts"] }