developit / developit/preact-jsx-chai

Shallow rendering with context provider

Open
#56 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
56
Forks
7
PR merge metrics
No merged PRs in 30d

Description

I am using a provider component to add context to the components I am testing.

Example:
```js
expect((



)).to.eql('');
```

In that case, I am required to do a non-shallow rendering/deep comparison with `eql` instead of `equal`. If I don't (and use `equal`), the rendered HTML that I get is `` (which is to be expected).

That being said, what I am looking for here is doing a shallow rendering "two levels deep" where `` gets rendered but not its children.

Is there any way to do that currently with `preact-jsx-chai`? Is there another way to provide the context without losing the ability to do shallow rendering?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.