Skip to content

Instantly share code, notes, and snippets.

@eunsukimme
Created June 30, 2021 12:24
Show Gist options
  • Save eunsukimme/c122e9ab593d2144e9d49ae77f158740 to your computer and use it in GitHub Desktop.
Save eunsukimme/c122e9ab593d2144e9d49ae77f158740 to your computer and use it in GitHub Desktop.
test code for Counter component with @testing-library/react
import React from "react";
import { render } from "@testing-library/react";
import Counter from "./Counter";
it("Counter 컴포넌트를 렌더링합니다", () => {
const { getByText } = render(<Counter />);
getByText("Counter: 0");
getByText("+");
getByText("-");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment