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
Vue: Cleanup Vue Code #2131
Vue: Cleanup Vue Code #2131
Conversation
🦋 Changeset detectedLatest commit: 4b35b10 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -5,7 +5,7 @@ | |||
"strict": true, | |||
"jsx": "preserve", | |||
"importHelpers": true, | |||
"declaration": true, | |||
"declaration": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the issue with script setup
and having an interface
in it, and getting an error message.
import { defineConfig } from 'vite'; | ||
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; | ||
import path from 'path'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import typescript2 from 'rollup-plugin-typescript2'; | ||
import Components from 'unplugin-vue-components/vite'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use JSX in our tests now, or in our components if needed.
"babel-jest": "^26.3.1", | ||
"c8": "^7.11.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what vitest uses for code coverage.
@@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils'; | |||
import { Authenticator } from '../dist'; | |||
import crypto from 'crypto'; | |||
|
|||
// This is needed for jest to get crypto module needed by nanoid | |||
// This is needed for vitest to get crypto module needed by nanoid | |||
Object.defineProperty(global.self, 'crypto', { | |||
value: { | |||
getRandomValues: (arr: Array<any>) => crypto.randomBytes(arr.length), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if this polyfill is still needed, and if so, can you try more scoped type for Array<any>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I can update that so GH does not complain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK fixed. 4b35b10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Closed for #2184 |
Description of changes
Moved from Jest to Vitest for Vue testing
Added in JSX - For future tests or primitives
Fixed issue with Code Editor error Default export of the module has or is using private name in any script setup file that has an interface
Issue #, if available
#2027
Description of how you validated changes
Test passed
Checklist
yarn test
passessideEffects
field updatedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.