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:
;; ;