-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings in frontend tests #3625
Conversation
The transformation jest uses cannot collect coverage for optional chaining (?.). Failed to collect coverage from /home/runner/work/ecamp3/ecamp3/frontend/src/views/camp/Invitation.vue ERROR: Unexpected token (1:1001) STACK: SyntaxError: Unexpected token (1:1001) at Parser.pp$4.raise (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:2757:13) at Parser.pp.unexpected (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:647:8) at Parser.pp$3.parseExprAtom (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:2196:10)
Else jest complains: Jest encountered an unexpected token ... /home/runner/work/ecamp3/ecamp3/frontend/node_modules/url-template/lib/url-template.js:97 export function parseTemplate(template) { ^^^^^^
Else jest complains that the component is not registered. Also fix Admin.spec.js, was broken in 020ffab.
Seems the problem with optional chaining was fixed with jest 29: So maybe it would still be worth to try merging #3566 What do you think? |
Until now we had only 2 places were this optional chaining was used. Another way with which we can get away from the jest problems is switching to vitest (#3268 ) |
converted it to draft, because this work may be unnecessary with #3268 |
not needed anymore with #3268 |
Invitation.vue: do not use optional chaining in template
The transformation jest uses cannot collect coverage for optional chaining (?.).
Failed to collect coverage from /home/runner/work/ecamp3/ecamp3/frontend/src/views/camp/Invitation.vue
ERROR: Unexpected token (1:1001)
STACK: SyntaxError: Unexpected token (1:1001)
at Parser.pp$4.raise (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:2757:13)
at Parser.pp.unexpected (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:647:8)
at Parser.pp$3.parseExprAtom (/home/runner/work/ecamp3/ecamp3/frontend/node_modules/vue-template-es2015-compiler/buble.js:2196:10)
frontend: transform package url-template in jest tests
Else jest complains:
Jest encountered an unexpected token
...
/home/runner/work/ecamp3/ecamp3/frontend/node_modules/url-template/lib/url-template.js:97
export function parseTemplate(template) {
^^^^^^
Admin.vue: register CampConditionalFields component
Else jest complains that the component is not registered.
Also fix Admin.spec.js, was broken in 020ffab.