Commit Graph

8 Commits

Author SHA1 Message Date
Cédric Exbrayat
9ecee16f89
chore: add no-debugger eslint rule (#5906) 2022-05-12 19:10:00 -04:00
lidlanca
1574edd490
fix(runtime-core): allow spying on proxy methods regression (#5417)
fix #5415 (regression by #4216)
2022-02-13 20:40:12 -05:00
Cédric Exbrayat
8457d8b980
fix(runtime-core): allow spying on proxy methods (#4216)
Since Jest v26.6.1, the mock method changed (see this commit 30e8020362)  to rely on `Object.defineProperty` in some cases.

This breaks spying on proxy's methods, because even if Jest is properly calling `Object.defineProperty`, the cached value in the `get` section of the proxy is never updated, and the spy is in fact never used.
This is easily reproducible as vue-next already uses a version of jest with these changes.

This is blocking projects (like vue-test-utils-next and vue-cli) to update to recent Jest versions.

This commit adds a `defineProperty` method to the proxy handler, that properly updates the defined value in the cache.
2022-02-12 03:35:05 -05:00
Evan You
aac0466cb8 fix(runtime-core): fix component public instance has check for accessed non-existent properties
close #4962
2021-11-25 18:15:06 +08:00
Evan You
47f488350c chore: run updated prettier 2021-07-19 18:24:18 -04:00
Evan You
3e815be24e wip: fix tests 2021-04-26 17:35:30 -04:00
Evan You
7e0224aa8c wip: more compat tweaks 2021-04-22 14:59:54 -04:00
Evan You
75fdcd85ce chore: rename test to match src filename 2021-03-01 12:30:04 -05:00