apps/web: add vitest
This commit is contained in:
parent
80e54ac294
commit
2b14158d29
8
apps/web/app/page.test.tsx
Normal file
8
apps/web/app/page.test.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
import Page from './page';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { expect, test } from 'vitest';
|
||||
|
||||
test('Page', () => {
|
||||
render(<Page />);
|
||||
expect(screen.getByRole('button', { name: 'Click me' })).toBeDefined();
|
||||
});
|
||||
@ -10,32 +10,38 @@
|
||||
"lint": "next lint",
|
||||
"check-types": "tsc --noEmit",
|
||||
"lint-staged": "lint-staged",
|
||||
"graphql:codegen": "graphql-codegen --config graphql.config.cjs"
|
||||
"graphql:codegen": "graphql-codegen --config graphql.config.cjs",
|
||||
"test:unit": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.12.2",
|
||||
"@apollo/client": "catalog:",
|
||||
"@repo/ui": "workspace:*",
|
||||
"graphql": "^16.9.0",
|
||||
"graphql": "catalog:",
|
||||
"next": "catalog:",
|
||||
"react": "catalog:",
|
||||
"react-dom": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/cli": "5.0.3",
|
||||
"@graphql-codegen/typed-document-node": "^5.0.12",
|
||||
"@graphql-codegen/typescript": "^4.1.2",
|
||||
"@graphql-codegen/typescript-operations": "^4.4.0",
|
||||
"@graphql-typed-document-node/core": "^3.2.0",
|
||||
"@graphql-codegen/cli": "catalog:",
|
||||
"@graphql-codegen/typed-document-node": "catalog:",
|
||||
"@graphql-codegen/typescript": "catalog:",
|
||||
"@graphql-codegen/typescript-operations": "catalog:",
|
||||
"@graphql-typed-document-node/core": "catalog:",
|
||||
"@repo/eslint-config": "workspace:*",
|
||||
"@repo/lint-staged-config": "workspace:*",
|
||||
"@repo/typescript-config": "workspace:*",
|
||||
"@testing-library/react": "catalog:",
|
||||
"@types/node": "catalog:",
|
||||
"@types/react": "catalog:",
|
||||
"@types/react-dom": "catalog:",
|
||||
"@vitejs/plugin-react": "catalog:",
|
||||
"autoprefixer": "catalog:",
|
||||
"jsdom": "catalog:",
|
||||
"lint-staged": "catalog:",
|
||||
"postcss": "catalog:",
|
||||
"tailwindcss": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
"typescript": "catalog:",
|
||||
"vite-tsconfig-paths": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
10
apps/web/vitest.config.mts
Normal file
10
apps/web/vitest.config.mts
Normal file
@ -0,0 +1,10 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tsconfigPaths(), react()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
},
|
||||
});
|
||||
@ -8,7 +8,8 @@
|
||||
"format": "prettier --end-of-line lf --write \"**/*.{ts,tsx,md,mjs}\"",
|
||||
"prepare": "husky",
|
||||
"lint-staged": "turbo lint-staged",
|
||||
"graphql:codegen": "turbo graphql:codegen"
|
||||
"graphql:codegen": "turbo graphql:codegen",
|
||||
"test:unit": "turbo test:unit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "catalog:",
|
||||
|
||||
1262
pnpm-lock.yaml
generated
1262
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -2,18 +2,28 @@ packages:
|
||||
- apps/*
|
||||
- packages/*
|
||||
catalog:
|
||||
"@apollo/client": ^3.12.2
|
||||
"@graphql-codegen/cli": 5.0.3
|
||||
"@graphql-codegen/typed-document-node": ^5.0.12
|
||||
"@graphql-codegen/typescript": ^4.1.2
|
||||
"@graphql-codegen/typescript-operations": ^4.4.0
|
||||
"@graphql-typed-document-node/core": ^3.2.0
|
||||
"@radix-ui/react-slot": ^1.1.0
|
||||
"@testing-library/react": ^16.1.0
|
||||
"@types/node": ^20
|
||||
"@types/react": ^19
|
||||
"@types/react-dom": ^19
|
||||
"@vchikalkin/eslint-config-awesome": ^2.0.6
|
||||
"@vitejs/plugin-react": ^4.3.4
|
||||
autoprefixer: ^10.4.20
|
||||
class-variance-authority: ^0.7.1
|
||||
clsx: ^2.1.1
|
||||
eslint: ^9.15.0
|
||||
eslint-plugin-tailwindcss: ^3.17.5
|
||||
eslint-plugin-turbo: ^2.3.0
|
||||
graphql: ^16.9.0
|
||||
husky: ^9.1.7
|
||||
jsdom: ^25.0.1
|
||||
lint-staged: ^15.2.10
|
||||
lucide-react: ^0.462.0
|
||||
next: ^15.0.4
|
||||
@ -27,3 +37,5 @@ catalog:
|
||||
tailwindcss-animate: ^1.0.7
|
||||
turbo: ^2.3.2
|
||||
typescript: ^5.7
|
||||
vite-tsconfig-paths: ^5.1.4
|
||||
vitest: ^2.1.8
|
||||
|
||||
@ -22,6 +22,9 @@
|
||||
},
|
||||
"graphql:codegen": {
|
||||
"cache": false
|
||||
},
|
||||
"test:unit": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user