Skip to content

Commit

Permalink
chore: fix eslint errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ImBIOS committed Jul 29, 2024
1 parent 8d226a4 commit e19e957
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/test-vitest/components/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { describe, expect, it, vi } from "vitest";
import { Footer } from "./Footer";

vi.mock("next-i18next", () => ({
Trans: ({ children }: { children: React.ReactNode }) => <>{children}</>,
useTranslation: () => ({
t: (key: string) => key,
}),
Trans: ({ children }: { children: React.ReactNode }) => <>{children}</>,
}));

vi.mock("next-i18next/package.json", () => ({
Expand Down
8 changes: 4 additions & 4 deletions examples/test-vitest/pages/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ const mockChangeLanguage = vi.fn();

vi.mock("next/router", () => ({
useRouter: () => ({
asPath: "/",
locale: "en",
push: mockPush,
pathname: "/",
asPath: "/",
push: mockPush,
query: {},
}),
}));

vi.mock("next-i18next", () => ({
Trans: ({ children }: { children: React.ReactNode }) => <>{children}</>,
useTranslation: () => ({
t: (key: string) => key,
i18n: {
changeLanguage: mockChangeLanguage,
},
t: (key: string) => key,
}),
Trans: ({ children }: { children: React.ReactNode }) => <>{children}</>,
}));

vi.mock("../components/Footer", () => ({
Expand Down
8 changes: 4 additions & 4 deletions examples/test-vitest/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [react()],
test: {
environment: "jsdom",
setupFiles: ["./vitest.setup.ts"],
coverage: {
provider: "v8",
include: ["components/**/*", "pages/**/*"],
exclude: [
"**/_app.tsx",
"**/_document.tsx",
Expand All @@ -29,6 +25,10 @@ export default defineConfig({
"**/vitest.{workspace,projects}.[jt]s?(on)",
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}",
],
include: ["components/**/*", "pages/**/*"],
provider: "v8",
},
environment: "jsdom",
setupFiles: ["./vitest.setup.ts"],
},
});
4 changes: 2 additions & 2 deletions examples/test-vitest/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as matchers from "@testing-library/jest-dom/matchers";
import matchers from "@testing-library/jest-dom/matchers";
import "@testing-library/jest-dom/vitest";
import { cleanup } from "@testing-library/react";
import { afterEach, expect } from "vitest";

expect.extend(matchers);
expect.extend({ ...matchers });

afterEach(() => {
cleanup();
Expand Down

0 comments on commit e19e957

Please sign in to comment.