私はコンポーネントデフをテストしようとしていますが、私は得られません。AVAで@decorator(redux-connect)を使用したテストコンポーネントのデコレーターとは?
例:
import React, { Component } from 'react'
import { connect } from 'react-redux'
@connect(({ user }) => ({ user }))
export class Componente extends Component {
render() {
return <div>hello {this.props.user}</div>
}
}
例試験:
import test from 'ava'
import Component from './Component'
import { mount } from 'enzyme'
test('<Component />', t => {
let wrapper = mount(<Component />) // the connect's redux create a wrapper component :(
})
非装飾コンポーネントをテストすることができますか?どうやって?
デコレータは*提案*ですが、ES7には含まれていません。 –