Skip to content
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 Test Utils: Errors messages about overwriting methods #355

Open
heathharrelson opened this issue Feb 20, 2021 · 0 comments
Open

Vue Test Utils: Errors messages about overwriting methods #355

heathharrelson opened this issue Feb 20, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@heathharrelson
Copy link
Member

heathharrelson commented Feb 20, 2021

Vue Test Utils is warning about tests that overwrite components' methods block:

ERROR LOG: '[vue-test-utils]: overwriting methods via the `methods` property is deprecated and will be removed in the next major version. There is no clear migration path for the `methods` property - Vue does not support arbitrarily replacement of methods, nor should VTU. To stub a complex method extract it from the component and test it in isolation. Otherwise, the suggestion is to rethink those tests.'

IIRC, this is done to work around the fact that I couldn't get Jasmine's mock clock to work correctly with debounce.

// stub out the use of debounce so test runs synchronously
methods: {
validateChanges(evt) {
const { target } = evt;
this.validateInput(target);
}
}

These tests should be reworked to eliminate the errors.

@heathharrelson heathharrelson added the bug Something isn't working label Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant