react-fix-it

Automagically generate tests from errors

  • 所有者: MicheleBertoli/react-fix-it
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

React Fix It Build Status

Automagically generate tests from errors.

:warning: 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)

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

主要指標

概覽
名稱與所有者MicheleBertoli/react-fix-it
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2016-12-15 08:59:34
推送於2018-09-24 03:54:20
最后一次提交2016-12-24 14:05:50
發布數5
最新版本名稱v0.3.3 (發布於 2016-12-24 14:05:50)
第一版名稱v0.2.0 (發布於 )
用户参与
星數1.9k
關注者數26
派生數21
提交數19
已啟用問題?
問題數2
打開的問題數0
拉請求數1
打開的拉請求數1
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?