alsatian-enzyme
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

alsatian-enzyme

This package provides helpers for testing React components in Typescript with Enzyme and Alsatian.

Installation

npm i alsatian-enzyme

Usage

import { Test, TestFixture } from "alsatian";
import { ExpectElement } from "alsatian-enzyme";
import { shallow } from "enzyme";
 
import { MyComponent } from "./MyComponent";
 
@TestFixture("MyComponent")
export class MyComponentTests {
 
    @Test("should render component")
    public shouldRenderComponent() {
 
        const wrapper = shallow(<MyComponent />);
 
        ExpectElement(wrapper).toMatchElement(
            <div>
                My components body.
            </div>
        );
    }
 
}

License

Made with 💖 by NewOrbit in Oxfordshire, and licensed under the MIT Licence

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i alsatian-enzyme

    Weekly Downloads

    90

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.81 kB

    Total Files

    7

    Last publish

    Collaborators

    • senderek
    • neworbit-admin
    • petevb
    • ksstott
    • thyde1
    • hisuwh