Skip to content

Commit

Permalink
test: cypress testing branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Lombardoc4 committed Jan 25, 2024
1 parent a709db0 commit 2eaf491
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module.exports = {
es2021: true,
node: true,
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'],
plugins: [
'@typescript-eslint',
'simple-import-sort',
'unused-imports',
'cypress',
],
extends: [
'eslint:recommended',
'next',
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ This project is using [conventional commits](https://www.conventionalcommits.org

// TODO [cypress](https://www.cypress.io/)

- **Be aware**

- Cypress uses a different ts `moduleResolution: node` from Next `bundler`, as a result of the difference the imports don't get formated properly
- Appending to top of your test file is the current fix `/* eslint-disable simple-import-sort/imports */`
- [Read More](https://github.com/cypress-io/cypress/issues/26308)

- **Running Cypress**

- `pnpm run cypress:open`
Expand Down
5 changes: 3 additions & 2 deletions cypress/component/Dropdown.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable simple-import-sort/imports */
// /* eslint-disable simple-import-sort/imports */

import { Dropdown } from '@/app/ui/Dropdown';
import '@/app/globals.css';

import { Dropdown } from '@/app/ui/Dropdown';

describe('Dropdown.cy.tsx', () => {
const initialVal = 'Initial Val';
const options = ['Option 1', 'Options2'];
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "next lint",
"lint:fix": "eslint src --fix && pnpm format",
"lint:strict": "eslint --max-warnings=0 src",
"lint:fix": "eslint . --fix && pnpm format",
"lint:strict": "eslint --max-warnings=0",
"postbuild": "next-sitemap --config next-sitemap.config.js",
"prepare": "husky install",
"release": "release-it",
Expand Down Expand Up @@ -47,6 +47,7 @@
"eslint": "latest",
"eslint-config-next": "latest",
"eslint-config-prettier": "latest",
"eslint-plugin-cypress": "latest",
"eslint-plugin-simple-import-sort": "latest",
"eslint-plugin-unused-imports": "latest",
"husky": "latest",
Expand Down
14 changes: 13 additions & 1 deletion pnpm-lock.yaml

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

0 comments on commit 2eaf491

Please sign in to comment.