Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

통합 워크플로우 #29

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 🔄 Integration

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run format:check
- run: bun run lint
- run: bun run coverage
- run: bun run build
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ dist-ssr
styled-system

# Tests
coverage
coverage

# TypeScript
*.tsbuildinfo
10 changes: 9 additions & 1 deletion src/components/ErrorPage/ErrorPage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { faker } from "@faker-js/faker";
import { render, screen } from "@testing-library/react";
import { useRouteError } from "react-router-dom";
import { expect, test, vi } from "vitest";
import { afterAll, beforeAll, expect, test, vi } from "vitest";
import ErrorPage from "./ErrorPage";

vi.mock("react-router-dom");

beforeAll(() => {
vi.spyOn(console, "error").mockImplementation(() => {});
});

afterAll(() => {
vi.mocked(console.error).mockRestore();
});
Comment on lines +9 to +15
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 결과에 어지럽게 에러 로그가 출력되지 않도록 하기 위함입니다.

  • before

Shot 2024-10-22 at 21 38 32@2x

  • after

Shot 2024-10-22 at 21 41 14@2x


test("displays the title and message", () => {
vi.mocked(useRouteError).mockReturnValue({
statusText: faker.lorem.sentence(),
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"include": [
"src",
/* Vitest */
"src/vitest.setup.ts",
"vitest.setup.ts",
/* PandaCSS */
"styled-system"
]
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
plugins: [react()],
test: {
environment: "happy-dom",
setupFiles: ["./src/vitest.setup.ts"],
setupFiles: ["./vitest.setup.ts"],
coverage: {
include: ["src/**/*.ts?(x)"],
thresholds: {
Expand Down
File renamed without changes.