-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
744 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { compilerOptions } = require('./tsconfig') | ||
|
||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
roots: ['<rootDir>'], | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
modulePaths: ['./'], | ||
setupFilesAfterEnv: ['./test/jestSetup.ts'], | ||
transform: { | ||
'^.+\\.(t|j)sx?$': [ | ||
'@swc/jest', | ||
{ | ||
jsc: { | ||
transform: { | ||
react: { | ||
runtime: 'automatic', | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
'.+\\.(css|less|sass|scss|png|jpg|gif|ttf|woff|woff2|svg)$': | ||
'jest-transform-stub', | ||
}, | ||
extensionsToTreatAsEsm: ['.ts', '.tsx'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { Button } from "@repo/ui"; | ||
export default function App() { | ||
return ( | ||
<div> | ||
<h4>Hello World</h4> | ||
<Button>Test</Button> | ||
</div> | ||
); | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { describe, expect, test } from "vitest"; | ||
import { screen, render } from "@testing-library/react"; | ||
import App from "./App"; | ||
|
||
describe("App", () => { | ||
test("renders", () => { | ||
render(<App />); | ||
expect(screen.getByText("Hello World")).toBeDefined(); | ||
}); | ||
}); | ||
import { screen, render, getByText } from '@testing-library/react' | ||
import App from './App' | ||
describe('App', () => { | ||
it('renders', () => { | ||
render(<App />) | ||
expect(screen.getByAltText('Hello World')).toBeInTheDocument() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@testing-library/jest-dom' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "@repo/typescript-config/react-library.json", | ||
"include": ["vite.config.ts", "**/*.ts", "**/*.tsx"], | ||
"include": ["test/jestSetup.ts", "**/*.ts", "**/*.tsx"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import type { Metadata } from "next"; | ||
import localFont from "next/font/local"; | ||
import "./globals.css"; | ||
import type { Metadata } from 'next' | ||
import localFont from 'next/font/local' | ||
import './globals.css' | ||
|
||
import { AntdRegistry } from "@ant-design/nextjs-registry"; | ||
import { AntdRegistry } from '@ant-design/nextjs-registry' | ||
import React from 'react' | ||
|
||
const geistSans = localFont({ | ||
src: "./fonts/GeistVF.woff", | ||
variable: "--font-geist-sans", | ||
weight: "100 900", | ||
}); | ||
src: './fonts/GeistVF.woff', | ||
variable: '--font-geist-sans', | ||
weight: '100 900', | ||
}) | ||
const geistMono = localFont({ | ||
src: "./fonts/GeistMonoVF.woff", | ||
variable: "--font-geist-mono", | ||
weight: "100 900", | ||
}); | ||
src: './fonts/GeistMonoVF.woff', | ||
variable: '--font-geist-mono', | ||
weight: '100 900', | ||
}) | ||
|
||
export const metadata: Metadata = { | ||
title: "Create Next App", | ||
description: "Generated by create next app", | ||
}; | ||
title: 'Create Next App', | ||
description: 'Generated by create next app', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
children: React.ReactNode | ||
}>) { | ||
return ( | ||
<html lang="en"> | ||
<body className={`${geistSans.variable} ${geistMono.variable}`}> | ||
<AntdRegistry>{children}</AntdRegistry> | ||
</body> | ||
</html> | ||
); | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.