bug: get undefined on updated State value on test when create page in beforeAll
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Inizia dal repository di riproduzione e dal test non riuscito src/components/my-component/my-component.spec.ts, in particolare dalla relativa configurazione beforeAll e dal listener ChangeValue. Traccia l’aggiornamento di stateValue attraverso lo Stencil testing runtime, dove viene segnalato l’errore $hostElement$. Il lavoro è completato quando il test riprodotto del listener supera il test senza l’errore di valore non definito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.7.0
Current Behavior
FAIL src/components/my-component/my-component.spec.ts
● my-component › test error
TypeError: Cannot read properties of undefined (reading '$hostElement$')
27 | @Listen('ChangeValue')
28 | onChangeValue(event: CustomEvent<string>) {
> 29 | this.stateValue = event.detail;
| ^
30 | }
31 |
32 | render() {
at setValue (node_modules/@stencil/core/internal/testing/index.js:541:58)
at MyComponent.set [as stateValue] (node_modules/@stencil/core/internal/testing/index.js:589:6)
at MyComponent.onChangeValue (src/components/my-component/my-component.tsx:29:20)
at p.<anonymous> (node_modules/@stencil/core/internal/testing/index.js:930:65)
at node_modules/@stencil/core/mock-doc/index.cjs:714:34
at Array.forEach (<anonymous>)
at triggerEventListener (node_modules/@stencil/core/mock-doc/index.cjs:712:19)
at dispatchEvent (node_modules/@stencil/core/mock-doc/index.cjs:733:5)
at p.dispatchEvent (node_modules/@stencil/core/mock-doc/index.cjs:3400:16)
at Object.<anonymous> (src/components/my-component/my-component.spec.ts:20:10)
Expected Behavior
get green test passed
System Info
$ npx stencil info
System: node 18.17.1
Platform: windows (10.0.22621)
CPU Model: 12th Gen Intel(R) Core(TM) i7-1265U (12 cpus)
Compiler: C:\Users\[USERNAME]\workspace\banana\node_modules\@stencil\core\compiler\stencil.js
Build: 1706543579
Stencil: 4.12.0
TypeScript: 5.3.3
Rollup: 2.56.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.27.0
Steps to Reproduce
- create proyect
- create state in component
- create Listen in component
- create page in beforeAll
- create test for Listen
- run test
Code Reproduction URL
https://github.com/jjmato/stencil-error-example
Additional Information
No response
- Lingua principale
- TypeScript
- Stelle
- 13.2k
- Fork
- 865
- Merge medio
- 2g 16h
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stenciljs/core
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug(mock-doc): `Element.toggleAttribute()` is missing, so components that use it fail during SSRApertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Stencil FOUC styles should use @layer to avoid cascade conflicts with React 19Forse già presa @johnjenkins l’ha presa 230 giorni fa. ApertaStencil v5
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
stenciljs/core#7016 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stenciljs/core
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AykutSarac/jsoncrack.com#616 ·
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtagForse già presa @bardrop l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nbd-wtf/nostr-tools#578 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
backnotprop/plannotator#3427 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/Power-CAT-Copilot-Studio-Kit#942 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AOSSIE-Org/DebateAI#801 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno