• Stars
    star
    1,911
  • Rank 24,257 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automagically generate tests from errors

React Fix It Build Status

Automagically generate tests from errors.

⚠️ This package uses react-component-errors to wrap the lifecycle methods into a try...catch block, which affects the performance of your components. Therefore it should not be used in production.

How to use it

  • Enhance your components with fixIt
  • Write some bugs (or wait for your components to fail)
  • Open the console and copy the test snippet
  • Paste the code to reproduce the error
  • Fix the bugs and celebrate

Demo

https://michelebertoli.github.io/react-fix-it/

Preview

Installation

You can either install it with npm or yarn.

npm install --save-dev react-fix-it

or

yarn add --dev react-fix-it

Example

import React, { Component } from 'react'
import fixIt, { options } from 'react-fix-it'

// defaults to console.log
options.log = (test) => {
  console.warn(test)
  doWatheverYouWant(test)
}

class MyComponent extends Component {
  render() {
    return <div>Hello ⚛</div>
  }
}

export default fixIt(MyComponent)

💡 They easiest way to patch automatically all the components in development mode is by using babel-plugin-react-fix-it with the following configuration:

{
  "env": {
    "development": {
      "plugins": ["react-fix-it"]
    }
  }
}

Test

npm test

or

yarn test

More Repositories

1

css-in-js

React: CSS in JS techniques comparison
JavaScript
5,530
star
2

react-automata

A state machine abstraction for React
JavaScript
1,338
star
3

react-gmaps

A Google Maps component for React.js
JavaScript
317
star
4

react-design-patterns-and-best-practices

React Design Patterns and Best Practices
JavaScript
198
star
5

react-worker

Using Service Workers to render React components
JavaScript
187
star
6

react-count-to

Animated counter component for React.js
Dockerfile
61
star
7

jquery-html5-uploader

jQuery drag&drop file uploader
JavaScript
57
star
8

react-poop

The ultimate error handler for React
JavaScript
56
star
9

react-only-if

Render a React.js component only if
JavaScript
49
star
10

postcss-composes

PostCSS plugin to make CSS Modules' composes work with any selectors
JavaScript
26
star
11

react-render-with-params

The render method you've always wanted
JavaScript
24
star
12

emoji-reporter

❤️ The best mocha reporter ever
JavaScript
23
star
13

react-data-provider

Because the Context is too mainstream
JavaScript
18
star
14

atomic-css-modules

15
star
15

babel-plugin-react-fix-it

Babel plugin for react-fix-it
JavaScript
15
star
16

grunt-po2mo

Compile .po files into binary .mo files with msgfmt.
JavaScript
14
star
17

react-test-perf

React test runners performance benchmark
JavaScript
11
star
18

proper-error-handling

JavaScript
11
star
19

react-payment-request

A Payment Request component for React.js
JavaScript
11
star
20

DotFuzzy

Open Source Fuzzy Logic Library
C#
9
star
21

old

Skype and Tumblr integration
JavaScript
6
star
22

PagOnline

Italian Unicredit PagOnline Payment Gateway for WP e-Commerce
PHP
6
star
23

dirty-markup

Automatically remove inline CSS styles from your HTML
JavaScript
4
star
24

basscss-modules

It's just me playing with Basscss and CSS Modules
JavaScript
2
star
25

react-speech

Speech Recognition mixin for React.js
JavaScript
2
star
26

BusDepartureBoardApp

OutOfView's coding challenge
JavaScript
1
star
27

JobCreation

Bizzby's coding challenge
JavaScript
1
star
28

brainpirlo

Playing with Backbone.js
JavaScript
1
star
29

css-modules-extractor

Extractor library for CSS Modules Compiler
JavaScript
1
star