diff --git a/apps/docs/app/feat1/page.test.tsx b/apps/docs/app/feat1/page.test.tsx new file mode 100644 index 0000000..d72f0d6 --- /dev/null +++ b/apps/docs/app/feat1/page.test.tsx @@ -0,0 +1,10 @@ +import { expect, test } from "@jest/globals"; +import { render, screen } from "@testing-library/react"; +import Page from "./page"; + +test("Page", () => { + render(); + expect( + screen.getByRole("heading", { level: 1, name: "Feat 1" }) + ).toBeDefined(); +}); diff --git a/apps/docs/app/feat1/page.tsx b/apps/docs/app/feat1/page.tsx new file mode 100644 index 0000000..2b2a05f --- /dev/null +++ b/apps/docs/app/feat1/page.tsx @@ -0,0 +1,51 @@ +"use client"; + +import { useState } from "react"; + +function ToggleContent({ + children, + defaultShow = false, +}: { + children?: React.ReactNode; + defaultShow?: boolean; +}) { + const [show, setShow] = useState(defaultShow); + return ( +
+ + {show ? children : null} +
+ ); +} + +export default function Page() { + const ranNum = Math.round(Math.random() * 100); + + return ( + <> +

Feat 1

+ + +

+ P1: + Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dolorem, + voluptatem mollitia suscipit odio eos fugiat eum in molestias itaque + ex magni fuga deleniti dolores. Accusamus blanditiis reiciendis ab + quibusdam saepe. +

+
+ +

+ P2: + Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dolorem, + voluptatem mollitia suscipit odio eos fugiat eum in molestias itaque + ex magni fuga deleniti dolores. Accusamus blanditiis reiciendis ab + quibusdam saepe. +

+
+ + {ranNum > 50 &&

Random number is greater than 50

} + {ranNum <= 50 &&

Random number is less than 50

} + + ); +} diff --git a/apps/docs/jest.config.ts b/apps/docs/jest.config.ts index ce34bb7..f4e53c0 100644 --- a/apps/docs/jest.config.ts +++ b/apps/docs/jest.config.ts @@ -27,6 +27,15 @@ const config: Config = { // Indicates whether the coverage information should be collected while executing the test collectCoverage: true, + collectCoverageFrom: [ + "**/*.{ts,tsx,s,mjs,mts}", + "!jest.config.ts", + "!next.config.mjs", + "!**/*.d.ts", + "!**/node_modules/**", + "!**/vendor/**", + ], + // An array of glob patterns indicating a set of files for which coverage information should be collected // collectCoverageFrom: undefined, @@ -39,7 +48,7 @@ const config: Config = { // ], // Indicates which provider should be used to instrument code for coverage - coverageProvider: "v8", + coverageProvider: "babel", // A list of reporter names that Jest uses when writing coverage reports // coverageReporters: [