Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mattcheely/stencil-decorator-test-test

Example / check of decorator issues when testing StencilJS components
https://github.com/mattcheely/stencil-decorator-test-test

Last synced: 24 days ago
JSON representation

Example / check of decorator issues when testing StencilJS components

Awesome Lists containing this project

README

        

# Broken Unit Tests With Decorator Example

This repo demonstrates a using a [basic TS decorator](src/utils/log-decorator.ts)
in [a component](src/components/my-component/my-component.tsx). In stencil v4
it's impossible to unit test this component, as Jest fails with an error:

```
● Test suite failed to run

ReferenceError: _logResize_decorators is not defined

at src/components/my-component/my-component.tsx:145:25
at Object. (src/components/my-component/my-component.tsx:147:3)
at Object. (src/components/my-component/my-component.spec.ts:2:1)
```