OCTRI/REDCap-Vizr

Vue Test Utils: Errors messages about overwriting `methods`

heathharrelson opened this issue · 0 comments

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.