developit / developit/preact-jsx-chai
Indentation works against `contains` test
- Dominant language
- JavaScript
- Stars
- 56
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
I found myself testing a `component` with nested components which I decided to mock. The `component` also returns a "lot" of html. That is why I decided to test the component contains certain pieces instead of for equality.
This is a valid example of the issue:
```
class MyComponent extends Component {
render({imgUrl}) {
return (
)
}
}
expect().to.contain(
)
```
The test will fail due to rendering of `MyComponent` vs. the contained render indents differ. See:
`MyComponent` output:
```
```
Test JSX output:
```
```
I think the easiest fix is to prevent indentation when using `contains` test. Output will not look nice but would still allow to have the test passing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.