Skip to content

Commit 74702fd

Browse files
committed
fix: tests and types
1 parent 1597871 commit 74702fd

File tree

6 files changed

+310
-210
lines changed

6 files changed

+310
-210
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"parserOptions": {
55
"project": ["./tsconfig.json"]
66
},
7-
"plugins": ["@typescript-eslint", "babel-plugin-styled-components"],
7+
"plugins": ["@typescript-eslint"],
88
"extends": [
99
"eslint:recommended",
1010
"plugin:@typescript-eslint/recommended",

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@
4343
"dev": "npm run storybook",
4444
"dev:watch": "rollup -cw",
4545
"build": "rollup -c",
46-
"test": "run-s test:unit test:lint test:build",
47-
"test:build": "run-s build",
48-
"test:lint": "eslint \"./src/**/*.+(ts|tsx)\"",
49-
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
50-
"test:watch": "react-scripts test --env=jsdom",
46+
"test": "vitest",
5147
"release": "npm run test && npm run prepare && dotenv release-it",
5248
"lint": "eslint src --ext .js,.ts,.tsx",
5349
"format": "prettier --write src",
@@ -71,17 +67,15 @@
7167
"@storybook/manager-webpack5": "^6.5.12",
7268
"@storybook/react": "^6.5.12",
7369
"@storybook/testing-library": "^0.0.13",
74-
"@testing-library/jest-dom": "^5.16.5",
7570
"@testing-library/react": "^13.4.0",
7671
"@testing-library/user-event": "^14.4.3",
77-
"@types/jest": "^29.0.3",
7872
"@types/node": "^18.7.18",
7973
"@types/react": "^18.0.20",
8074
"@types/react-dom": "^18.0.6",
75+
"@types/styled-components": "^5.1.26",
8176
"@typescript-eslint/eslint-plugin": "^5.38.0",
8277
"@typescript-eslint/parser": "^5.38.0",
8378
"babel-loader": "^8.2.5",
84-
"babel-plugin-styled-components": "^2.0.7",
8579
"cross-env": "^7.0.3",
8680
"dotenv-cli": "^6.0.0",
8781
"eslint": "^8.23.1",
@@ -104,7 +98,8 @@
10498
"rollup-plugin-postcss": "^4.0.2",
10599
"rollup-plugin-typescript2": "^0.34.0",
106100
"styled-components": "^5.3.5",
107-
"typescript": "^4.8.3"
101+
"typescript": "^4.8.3",
102+
"vitest": "^0.23.4"
108103
},
109104
"author": "Ugo Onali",
110105
"license": "MIT"

src/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ReactInputVerificationCode from '.';
22

33
describe('ReactInputVerificationCode', () => {
4-
it('is truthy', () => {
4+
test('is truthy', () => {
55
expect(ReactInputVerificationCode).toBeTruthy();
66
});
77
});

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"esModuleInterop": true,
66
"jsx": "react",
77
"lib": ["ES5", "ES2015", "ES2016", "DOM", "ESNext"],
8-
"types": ["jest", "node"],
8+
"types": ["vitest/globals", "node"],
99
"module": "es2015",
1010
"moduleResolution": "node",
1111
"noImplicitAny": false,

vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
globals: true,
6+
},
7+
});

0 commit comments

Comments
 (0)