import React, { Component } from 'react'
export default class Test extends Component {
render() {
return (
<div>
Hello
</div>
)
}
}
it('should Test with mount', () => {
const wrapper = mount(<Test />);
expect(wrapper).toBeTruthy();
});
it('should Test with render', () => {
const wrapper = shallow(<Test />);
expect(wrapper).toBeTruthy();
});
× should Test with mount (97ms)
√ should Test with render (29ms)
Monitoring component test without redux › should Test with mount
Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
21 |
22 | it('should Test with mount', () => {
> 23 | const wrapper = mount(<Test />);
24 | console.log(wrapper.debug());
25 |
26 | expect(wrapper).toBeTruthy();
fetch(url)
.then((response) => {
let reader = response.body.getReader()
let decoder = new TextDecoder('utf-8')
return reader.read().then((result) => {
return decoder.decode(result.value)
})
})
.then((csvData) => {
Papa.parse(csvData, {
complete: this.getData,
header: true
})
})
.catch((error) => {
console.log(error)
})
fetch(url)
.then((response) => {
let reader = response.body.getReader()
let decoder = new TextDecoder('utf-8')
return reader.read().then((result) => {
return decoder.decode(result.value)
})
})
.then((csvData) => {
Papa.parse(csvData, {
complete: this.getData,
header: true
})
})
.catch((error) => {
console.log(error)
})
fetch(url)
.then((response) => {
let reader = response.body.getReader()
let decoder = new TextDecoder('utf-8')
return reader.read().then((result) => {
return decoder.decode(result.value)
})
})
.then((csvData) => {
Papa.parse(csvData, {
complete: this.getData,
header: true
})
})
.catch((error) => {
console.log(error)
})
console.log(verify("[{}]")); //true