fail-tests-on-text

2.0.2 • Public • Published

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

Package Sidebar

Install

npm i fail-tests-on-text

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

3.56 kB

Total Files

6

Last publish

Collaborators

  • rouanw