-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Tests using createLocalVue() display warning (rc.20) #3303
Comments
The warnings should not cause tests to fail (but will place console warns in your test logs) Adding the You can disable BootstrapVue warns by setting https://bootstrap-vue.js.org/docs/misc/settings#disabling-bootstrapvue-console-warnings You can also set up a console.warn mock to trap the warns (which we have done in some of our tests): beforeAll(() => {
// Prevent multiple Vue warnings in tests
jest.spyOn(console, 'warn').mockImplementation(() => {})
// Install plugin after we have trapped console.warn
localVue.use(toastPlugin)
})
afterAll(() => {
console.warn.mockClear()
}) |
@tmorehouse You're right, it's just a warning but we've configured our tests so that any Anyway, can we expect that using |
It is more of an upstream issue with The warning is output to prevent duplicate issues like #3040 Several other libraries would run into this same test issues, such as |
I don't know if vue-test-utils provides an option to |
PR #3315 will suppress the |
Version 2.0.0-rc.21 has been released |
@tmorehouse thx! |
@Tim152 version 2.0.0-rc.22 will hopefully be released today or tomorrow, which fixes issues introduced with rc.21 |
Heyo it looks like
to Jest setup, and then remove Edit: Can I do the same thing with Vuex? |
I think that with your approach one have to use the same global |
Describe the bug
Tests using
bootstrap-vue
andcreateLocalVue()
output the following warningThe test code looks like:
Expected behavior
Tests run successfully without warnings.
Versions
Libraries:
bootstrap-vue
: 2.0.0-rc.20bootstrap
: 4.3.1vue
: 2.6.10jest
: 24.8.0vue-jest
: 3.0.4@vue/test-utils
: 1.0.0-beta.29Environment:
Jest
Possible solution?!
The issue can be fixed by moving the
localVue.use()
statement from the test fileto the
jestSetup.js
.Now the tests run successfully. But the question is: Is that intended?
The text was updated successfully, but these errors were encountered: