jest-vtu
Version:
jest matchers for vtu and support vue3
24 lines (23 loc) • 678 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var test_utils_1 = require("@vue/test-utils");
function getByTestId(testId) {
return this.get("[data-testid=" + testId + "]");
}
function findByTestId(testId) {
return this.find("[data-testid=" + testId + "]");
}
function vueWrapperPlugins() {
return {
getByTestId: getByTestId,
findByTestId: findByTestId,
};
}
function domWrapperPlugins() {
return {
getByTestId: getByTestId,
findByTestId: findByTestId,
};
}
test_utils_1.config.plugins.VueWrapper.install(vueWrapperPlugins);
test_utils_1.config.plugins.DOMWrapper.install(domWrapperPlugins);