// partial match of spy function params called with
let { given, when, get } = new CypressHelper();
it("should partially match spy params", () => {
const obj = {
func: (param: Object) => {}
};
given.spyOnObject(obj, "func");
obj.func({ shelly: "go", inner: { attr: "value" } });
then(get.spyFromFunction(obj.func)).shouldHaveBeenCalledWithMatch(
match({ inner: { attr: "value" } })
);
});
For more information see Sinon.match documentation
Sinon matcher for stubs/spy comparison
// partial match of spy function params called with
let { given, when, get } = new CypressHelper();
it("should partially match spy params", () => {
const obj = {
func: (param: Object) => {}
};
given.spyOnObject(obj, "func");
obj.func({ shelly: "go", inner: { attr: "value" } });
then(get.spyFromFunction(obj.func)).shouldHaveBeenCalledWithMatch(
match({ inner: { attr: "value" } })
);
});
For more information see Sinon.match documentation
Sinon matcher for stubs/spy comparison
// partial match of spy function params called with
let { given, when, get } = new CypressHelper();
it("should partially match spy params", () => {
const obj = {
func: (param: Object) => {}
};
given.spyOnObject(obj, "func");
obj.func({ shelly: "go", inner: { attr: "value" } });
then(get.spyFromFunction(obj.func)).shouldHaveBeenCalledWithMatch(
match({ inner: { attr: "value" } })
);
});
For more information see Sinon.match documentation
Sinon matcher for stubs/spy comparison
Optional
message: string// partial match of spy function params called with
let { given, when, get } = new CypressHelper();
it("should partially match spy params", () => {
const obj = {
func: (param: Object) => {}
};
given.spyOnObject(obj, "func");
obj.func({ shelly: "go", inner: { attr: "value" } });
then(get.spyFromFunction(obj.func)).shouldHaveBeenCalledWithMatch(
match({ inner: { attr: "value" } })
);
});
For more information see Sinon.match documentation
Sinon matcher for stubs/spy comparison
// partial match of spy function params called with
let { given, when, get } = new CypressHelper();
it("should partially match spy params", () => {
const obj = {
func: (param: Object) => {}
};
given.spyOnObject(obj, "func");
obj.func({ shelly: "go", inner: { attr: "value" } });
then(get.spyFromFunction(obj.func)).shouldHaveBeenCalledWithMatch(
match({ inner: { attr: "value" } })
);
});
For more information see Sinon.match documentation
Generated using TypeDoc
Sinon matcher for stubs/spy comparison