/turris-test-helpers

Turris.js test environment helpers

Primary LanguageJavaScript

WARNING! This package was deprecated in favor of plain dependencies as of turris-generator v0.8.0

This package will no longer be maintained.

Turris.js test environment helpers

Provides a simple way to create an environment for testing React.js components writter with ES6 without browser.

Includes things

  • jsdom with localStorage polyfill for all your DOM needs
  • React and TestUtils (exposed via mocha 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)

Installation

Package can be installed using NPM: npm install turris-test-helpers

Usage

It is recommended to import this file in the beginning of your test, e.g.: import should from 'turris-test-helpers'

Recommended libraries to use along

  • nock - if you need http requests mocking
  • proxyquire - if you need dependency stubbing

License

MIT