0.0.4 • Published 6 years ago

tiny-enzyme v0.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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.

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago