Skip to content

Instantly share code, notes, and snippets.

@pureooze
Created August 16, 2018 03:45
import { h } from "preact";
import { render, cleanup } from "preact-testing-library";
import Main from "../src/example/index";
import chrome from "sinon-chrome";
window.chrome = chrome;
test("should render Main component", () => {
const getUrl = function() {
return chrome.runtime.getURL("popup-content.html");
};
chrome.runtime.getURL.returns("http://localhost:1234/index.html");
const { container } = render(<Main getUrl={getUrl} />);
expect(container).toMatchSnapshot();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment