-
Notifications
You must be signed in to change notification settings - Fork 100
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
How to config with jest #417
Comments
In the docs of @vue/test-utils, you can use Applying Global Plugins and Mixins. For vue-final-modal, it might be like: import { createLocalVue, mount } from '@vue/test-utils'
import { createVfm } from 'vue-final-modal'
// create an extended `Vue` constructor
const localVue = createLocalVue()
// install plugins as normal
const vfm = createVfm()
localVue.use(vfm)
// pass the `localVue` to the mount options
mount(Component, {
localVue
}) |
Hi @hunterliu1003 |
@rock288 test('global.plugins', () => {
const vfm = createVfm()
mount(App, {
global: {
plugins: [vfm],
stubs: { transition: false },
},
})
}) |
Hi @hunterliu1003 |
Hi, `
` My BaseModal component is quite simple
Any idea anybody? |
Same for me. Trying to find out how I can test this modal component with vitest which is quite similar than jest. stubs: { transition: false }, It fails with an error message: Error: Your focus-trap must have at least one container with at least one tabbable node in it at all times. As I can see you guys used Cypress for doing integration tests but there is none unit tests examples in this repository. |
Version
vue-final-modal: 4.4.6
vue: 3.2.13
@vue/test-utils: 2.4.3
OS
Windows
Reproduction Link
Steps to reproduce
How to config with jest, use @vue/test-utils
What is Expected?
What is actually happening?
Can not config with jest
The text was updated successfully, but these errors were encountered: