Skip to content

Commit

Permalink
Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
te-sa committed Oct 11, 2023
1 parent a33845e commit 557c6a1
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 64 deletions.
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
// }
26 changes: 13 additions & 13 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
<!-- Used by Next.js to inject CSS. -->
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Components App</title>
<!-- Used by Next.js to inject CSS. -->
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
10 changes: 5 additions & 5 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import { mount } from 'cypress/react18'
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
namespace Cypress {
interface Chainable {
mount: typeof mount
}
}
}
}

Cypress.Commands.add('mount', mount)

// Example use:
// cy.mount(<MyComponent />)
// cy.mount(<MyComponent />)
2 changes: 1 addition & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
// require('./commands')
168 changes: 168 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/app/pageHome.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'
import Home from './page'

describe('<Home />', () => {
it('renders', () => {
// see: https://on.cypress.io/mounting-react
cy.mount(<Home />)
})
})
it('renders', () => {
// See: https://on.cypress.io/mounting-react
cy.mount(<Home />)
})
})
65 changes: 26 additions & 39 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
{
"compilerOptions": {
"baseUrl": "./", // fixes Cypress not finding tsconfig.json
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node", // Cypress can't handle "bundle"
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./src/*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
"compilerOptions": {
"baseUrl": "./", // fixes Cypress not finding tsconfig.json
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node", // Cypress can't handle "bundle"
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 557c6a1

Please sign in to comment.