Skip to content

Instantly share code, notes, and snippets.

View goncalobo's full-sized avatar

Gonçalo Lobo goncalobo

  • Porto, Portugal
View GitHub Profile
@goncalobo
goncalobo / index.test.js
Created February 26, 2019 13:59
Workaround to test a custom hook API (https://codesandbox.io/s/jvo251qqwy)
import React, { useState, useEffect } from "react";
import { act } from "react-dom/test-utils";
import ShallowRenderer from "react-test-renderer/shallow";
import Enzyme, { shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
Enzyme.configure({ adapter: new Adapter() });
// Custom Hook API being subject to testing