Skip to content

Instantly share code, notes, and snippets.

View trinwin's full-sized avatar
:octocat:
Creating 

Trinity Nguyen trinwin

:octocat:
Creating 
  • Apple
  • San Francisco Bay Area
View GitHub Profile
import React from "react";
import Button from "../Button";
import renderer from "react-test-renderer";
it("renders correctly", () => {
const tree = renderer.create(<Button text="Some Text" />).toJSON();
expect(tree).toMatchSnapshot();
});
import React from "react";
import { mount } from "enzyme";
import Home from "../../pages/index";
describe("Pages", () => {
describe("Home", () => {
it("should render without throwing an error", function () {
const wrap = mount(<Home />);
expect(wrap.find("h1").text()).toBe("Welcome to My Next App!");
});
});
import * as React from "react";
const Home = () => {
return <h1>Welcome to My Next App!</h1>;
};
export default Home;