Skip to content

Commit

Permalink
cypress: tweak linter config
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnord committed Aug 21, 2023
1 parent cc2f814 commit 6aaaee2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cypress/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
ignorePatterns: ["*.js"],
};
5 changes: 1 addition & 4 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ declare global {
// Also added custom types to avoid getting detached
// https://github.com/cypress-io/cypress/issues/7306#issuecomment-1152752612
// ===========================================================
function visitAndCheck(url: string, waitTime: number = 1000) {
export function visitAndCheck(url: string, waitTime = 1000) {
cy.visit(url);
cy.location("pathname").should("contain", url).wait(waitTime);
}

Cypress.Commands.add("visitAndCheck", visitAndCheck);

// Add an empty export so we can `declare global` above
export {};
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// 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')
1 change: 0 additions & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"typeRoots": ["../types", "../node_modules/@types"],

"paths": {
"~/*": ["../app/*"]
Expand Down

1 comment on commit 6aaaee2

@vercel
Copy link

@vercel vercel bot commented on 6aaaee2 Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.