Skip to content

Commit

Permalink
Add CY TS Config
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Oct 17, 2023
1 parent 5ffb1d9 commit 8d1b7c2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
1 change: 0 additions & 1 deletion cypress/component/integration/Balance.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../../../src/global.css';
import React from 'react';
import { Balance } from '../../../src/components';
import { compareSnapshot } from '../../compareSnapshot';

Expand Down
2 changes: 1 addition & 1 deletion cypress/component/unit/truncate.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { truncate } from '../../../src/util/truncate';
describe('Component | Unit | Util | Truncate', () => {
before(() => {
// check if the import worked correctly
expect(truncate, 'truncate').to.be.a('function');
expect(truncate).to.be.a('function');
});

context('truncate', function () {
Expand Down
7 changes: 7 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { mount } from 'cypress/react18';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import compareSnapshotCommand from 'cypress-image-diff-js/dist/command';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { RecurseDefaults } from 'cypress-recurse';

// Augment the Cypress namespace to include type definitions for
Expand Down
9 changes: 9 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"types": ["cypress", "node"],
"esModuleInterop": true
},
"include": ["**/*.ts", "./cypress.d.ts"]
}
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"react-test-renderer": "^18.2.0",
"storybook": "^7.4.5",
"tailwindcss": "^3.3.1",
"typescript": "^5.0.2",
"typescript": "^5.2.2",
"vite": "^4.3.0"
}
}
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"include": ["src", "cypress"],
"references": [{ "path": "./tsconfig.node.json" }]
}

0 comments on commit 8d1b7c2

Please sign in to comment.