0.0.4 • Published 6 years ago
tiny-enzyme v0.0.4
Tiny Enzyme
Minimal alternative to enzyme for preact.
Usage
Installation:
# npm
npm install --save-dev tiny-enzyme
# yarn
yarn add -D tiny-enzyme
Example test:
import { h } from "preact";
descripe("Example suite", () => {
it("should test something", () => {
const spy = jest.fn();
// Trigger a fake click
mount(<div onClick={spy} />).simulate("click");
// Check if our spy was called
expect(spy.mocks.calls.length).toEqual(1);
});
});
License
MIT, see License file.