IT大道IT大道

首页 > 源码 > react-fix-it: Automagically generate tests from errors

react-fix-it: Automagically generate tests from errors

原文 https://github.com/MicheleBertoli/react-fix-it 2016-12-16 12:09:02 0 评论
Automagically generate tests from errors

文件列表

src
test
.babelrc
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
demo.gif
package.json
yarn.lock

React Fix It

Automagically generate tests from errors.

Follow the flow:

  • 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

itdadao-MicheleBertoli/react-fix-it

Installation

yarn add --dev react-fix-it

Usage

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

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

export default fixIt(MyComponent)

Test

yarn test

下载地址

Download ZIP

Tags:JavaScript

标签列表