Feature request: Mocking/stubbing sub-views
- Dominant language
- TypeScript
- Stars
- 38
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I know this is heavily a work-in-progress library, but I also know you want feedback :)
Having used the ComponentTester for a few components we find the need for mocking/stubbing out sub-views which are imported through the html-require tag.
Prehaps a bit of background is helpful:
We have a separate suit of tests we call binding-tests. They are a form of regression-tests to avoid the problem of renaming view model properies and forgetting to rename the bindings in the HTML.
We want these as unit-tests so that we can get feedback asap.
This creates a problem where we have a component foo:
``` javascript
export class Foo {
fooData;
get processedFoo() {
return processFoo();
}
}
```
With html:
``` HTML
```
We want to check the binding for bar's 'some-data', but we do not want to parse the possibly complex output of bar in order to check that. Bar's output should not be a part of the test for Foo.
Is there a way to do this currently? Have you considered a use-case like this?
Contributor guide
Assessment
This issue has not been assessed yet.