vue-jest icon indicating copy to clipboard operation
vue-jest copied to clipboard

Upgrade TS target to ES6

Open ruojianll opened this issue 1 year ago • 3 comments

If a third package exported a ES6 native class, and a class in .vue file extends it. When calling super in constructor, get error TypeError: Class constructors cannot be invoked without 'new'.

Transformed classes (in ES5)) from .vue files are not compatible with native classes (in ES6) exported by third packages.

ES6 is also vue3 basic environment, so should we upgrade it?

https://github.com/vuejs/vue-jest/blob/master/packages/vue3-jest/lib/utils.js#L116

ruojianll avatar Apr 07 '23 07:04 ruojianll

That would be very useful for me :)

windsurfing33 avatar Apr 11 '23 18:04 windsurfing33

I've also been running into this issue, and it seems the problem is unfortunately more complex than just changing the target: https://github.com/vuejs/vue-jest/issues/445#issuecomment-1121714802. It is possible to add "downLevelIteratiion": true to your tsconfig.json's compilerOptions, but this will affect your production code as well.

rhianvanesch avatar Aug 29 '23 08:08 rhianvanesch

It would be useful for us too. vue-jest is incompatible with facing-dev/vue-facing-decorator so we are stuck with deprecated vue-property-decorator and vue-class-component.

stephdz avatar Aug 29 '23 12:08 stephdz