New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ecc-test-helpers

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecc-test-helpers

A common cli test environment and helpers for testing components, stores and widgets.

  • 15.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Eccenca test helpers (ecc-test-helpers)

Offers a simple way to create an environment for testing.

Currently includes:

  • jsdom with localStorage for all your DOM needs
  • React and TestUtils (exposed via mocha this context)
  • Container for rendering your component that is create before each test and disposed afterwards (exposed via mocha context)
  • Should.js for your assertions (exposed as default module export)

Usage

  • Install module into your project (and save as dev deps) using npm install --save-dev ecc-test-helpers
  • Import the module in the beginning of your test suite using import should from 'ecc-test-helpers'
  • Access React, TestUtils and test container using this context, like so:

import should from 'ecc-test-helpers';
import Component from '../src/component';

describe('Component suite', function() {
    describe('Component', function() {
        it('Should render ...', function() {
            const React = this.React;
            const TestUtils = this.TestUtils;

            // render
            const comp = React.render(
                <TestComp handleModelSelect={() => {}}/>,
                this.container
            );
            // ...
        });
    });
});

FAQs

Package last updated on 19 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc