-
-
Notifications
You must be signed in to change notification settings - Fork 834
bug: @Watch decorator not triggered on inherited classes in unit test environment (Stencil 4.37.x) #6399
Copy link
Copy link
Closed
Description
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.37.x
Current Behavior
The @Watch methods defined in the base class are not triggered in the subclass when running unit tests.
After upgrading to Stencil.js 4.37.x, I found an issue with the unit test environment when using class inheritance.
If a component extends a base class that defines @Watch methods, those watchers do not get triggered in the subclass during unit tests.
However, this problem only occurs in the test runner. In an actual browser environment, the inherited @Watch methods work as expected.
Expected Behavior
Inherited @Watch methods should be triggered in the unit test environment the same way they do in the browser.
System Info
System: node 20.15.1
Platform: darwin (24.6.0)
CPU Model: Apple M3 Pro (12 cpus)
Compiler: /Users/bytedance/Desktop/stencil-rue1b2al/node_modules/.pnpm/@stencil+core@4.37.1/node_modules/@stencil/core/compiler/stencil.js
Build: 1758315275
Stencil: 4.37.1 🏰
TypeScript: 5.5.4
Rollup: 4.34.9
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0Steps to Reproduce
- Fork the reproduction repository
- Run
npm install - Run
npm run test
Code Reproduction URL
https://github.com/stout-ni/stencil-rue1b2al
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels