@nodomx/test-utils
v0.2.6
Published
Official testing helpers for mounting and interacting with NodomX components.
Downloads
130
Maintainers
Readme
@nodomx/test-utils
Official mount helpers for NodomX component tests.
Usage
import { mount } from "@nodomx/test-utils";
import CounterView from "./CounterView.nd";
const wrapper = await mount(CounterView);
await wrapper.trigger("#inc", "click");
console.log(wrapper.text("#count"));
wrapper.destroy();Helpers
mount(component, options)createTestDom(options)flush()
mount() accepts a global option similar to Vue Test Utils:
await mount(App, {
global: {
provide: {
sharedLabel: "hello"
},
config: {
globalProperties: {
$format(value) {
return `count:${value}`;
}
}
}
}
});