diff --git a/.github/nodejs.version b/.github/nodejs.version index 2efc7e1..3d48712 100644 --- a/.github/nodejs.version +++ b/.github/nodejs.version @@ -1 +1 @@ -v20.11.1 \ No newline at end of file +v24.3.0 diff --git a/README.md b/README.md index 3f05f2a..5655d5e 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ With this template you will get all the boilerplate features included: * [GitHub Actions](https://github.com/features/actions) - Pre-configured workflows including bundle size and performance tracking * Perfect Lighthouse score - Optimized performance metrics * [Bundle analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) - Monitor and manage bundle size during development -* Testing suite - [Jest](https://jestjs.io/), [React Testing Library](https://testing-library.com/react), and [Playwright](https://playwright.dev/) for comprehensive testing +* Testing suite - [Vitest](https://vitest.dev), [React Testing Library](https://testing-library.com/react), and [Playwright](https://playwright.dev/) for comprehensive testing * [Storybook](https://storybook.js.org/) - Component development and documentation * Advanced testing - Smoke and acceptance testing capabilities * [Conventional commits](https://www.conventionalcommits.org/) - Standardized commit history management diff --git a/components/Button/Button.test.tsx b/components/Button/Button.test.tsx index b4462b0..f2b8da5 100644 --- a/components/Button/Button.test.tsx +++ b/components/Button/Button.test.tsx @@ -1,24 +1,32 @@ -import { describe, it, expect } from 'vitest' -import { render, screen } from '@testing-library/react' -import { Button } from './Button' +import { render, screen } from "@testing-library/react" +import { describe, expect, it } from "vitest" +import { Button } from "./Button" -describe('Button', () => { - it('renders with children', () => { +describe("Button", () => { + it("renders with children", () => { render() - expect(screen.getByText('Click me')).toBeInTheDocument() + expect(screen.getByText("Click me")).toBeInTheDocument() }) - it('applies correct intent classes', () => { - const { container } = render() - const link = container.querySelector('a') - expect(link).toHaveClass('bg-transparent') - expect(link).toHaveClass('text-blue-400') + it("applies correct intent classes", () => { + const { container } = render( + + ) + const link = container.querySelector("a") + expect(link).toHaveClass("bg-transparent") + expect(link).toHaveClass("text-blue-400") }) - it('applies correct size classes', () => { - const { container } = render() - const link = container.querySelector('a') - expect(link).toHaveClass('text-sm') - expect(link).toHaveClass('min-w-20') + it("applies correct size classes", () => { + const { container } = render( + + ) + const link = container.querySelector("a") + expect(link).toHaveClass("text-sm") + expect(link).toHaveClass("min-w-20") }) -}) \ No newline at end of file +}) diff --git a/vitest.config.ts b/vitest.config.ts index 86bf547..26eb441 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,14 +1,14 @@ -import { defineConfig } from 'vitest/config' -import react from '@vitejs/plugin-react' -import tsconfigPaths from 'vite-tsconfig-paths' +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', - setupFiles: './vitest.setup.ts', + environment: "jsdom", + setupFiles: "./vitest.setup.ts", globals: true, - testMatch: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'], - exclude: ['**/node_modules/**', '**/dist/**', '**/e2e/**', '.next/**'], + include: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"], + exclude: ["**/node_modules/**", "**/dist/**", "**/e2e/**", ".next/**"], }, -}) \ No newline at end of file +}) diff --git a/vitest.setup.ts b/vitest.setup.ts index 010b0b5..df6631e 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -1 +1 @@ -import '@testing-library/jest-dom' \ No newline at end of file +import "@testing-library/jest-dom"