0.0.5 • Published 7 years ago

@marvinh/tiny-enzyme v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Tiny Enzyme

Minimal alternative to enzyme for preact.

Usage

Installation:

# npm
npm install --save-dev @marvinh/tiny-enzyme

# yarn
yarn add -D @marvinh/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.