svelte-component-double
Version:
A test double for Svelte 3 components
25 lines (23 loc) • 605 B
JavaScript
const expect = require("expect");
expect.extend({
toBeRenderedIn(componentDouble, container) {
return toBeRenderedIn(componentDouble, container);
},
toBeRendered(componentDouble) {
return toBeRenderedIn(componentDouble, global.container);
},
toBeRenderedWithPropsIn(componentDouble, props, container) {
return toBeRenderedWithPropsIn.bind(this)(
componentDouble,
props,
container
);
},
toBeRenderedWithProps(componentDouble, props) {
return toBeRenderedWithPropsIn.bind(this)(
componentDouble,
props,
global.container
);
},
});