JSPM

fail-tests-on-text

2.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q23452F
  • License MIT

A utility that fails your tests when some text is logged during execution

Package Exports

  • fail-tests-on-text

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fail-tests-on-text) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fail-tests-on-text

npm version Dependency Status Open Source Love

Need to fail your tests when some text is output?

We use this because we were tired of React warnings slipping into our code base unnoticed.

1. Install

npm install --save-dev fail-tests-on-text

2. Use

import failTestsOnText from 'fail-tests-on-text';

failTestsOnText('Warning:'); // In your test setup somewhere. This works great for catching React warnings (but will catch other stuff too!)

3. Profit

Now any test that causes a React warning to be logged to the console will fail.

Tested with Mocha and Tape using React 16.

Licence

MIT