# ecc-test-helpers

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

Latest version **15.2.0** (published 2017-06-19) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install ecc-test-helpers
pnpm add ecc-test-helpers
yarn add ecc-test-helpers
bun add ecc-test-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 15.2.0 |
| Published | 2017-06-19 |
| First published | 2016-05-12 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | eccenca GmbH |
| Maintainers | eccenca-admin, kvollers, leipert |

## Links

- npm: https://www.npmjs.com/package/ecc-test-helpers
- Repository: https://github.com/elds/ecc-test-helpers
- Homepage: https://github.com/elds/ecc-test-helpers#readme
- Issues: https://github.com/elds/ecc-test-helpers/issues
- npm.io page: https://npm.io/package/ecc-test-helpers

## Dependencies (6)

- [intl](https://npm.io/package/intl.md) ^1.2.5
- [jsdom](https://npm.io/package/jsdom.md) ^9.12.0
- [react](https://npm.io/package/react.md) ^15.6.1
- [should](https://npm.io/package/should.md) ^11.2.1
- [react-dom](https://npm.io/package/react-dom.md) ^15.6.1
- [localStorage](https://npm.io/package/localStorage.md) ^1.0.3

## Recent versions

- 15.2.0 (latest) — 2017-06-19
- 15.1.0 — 2016-07-28
- 15.0.1 — 2016-07-27
- 15.0.0 — 2016-05-17
- 1.2.1 — 2016-05-12
- 1.0.0 — 2016-05-12

## README

# Eccenca test helpers (ecc-test-helpers)

Offers a simple way to create an environment for testing.  

Currently includes:  

- [jsdom](https://github.com/tmpvar/jsdom) with [localStorage](https://github.com/lmaccherone/node-localstorage) for all your DOM needs
- [React](https://facebook.github.io/react/) and [TestUtils](https://facebook.github.io/react/docs/test-utils.html) (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](https://github.com/shouldjs/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:

```js

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
            );
            // ...
        });
    });
});
```

---
_Source: https://npm.io/package/ecc-test-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
