js: Test existing call convention
This commit is contained in:
parent
6864cc97ea
commit
9ed17b222a
@ -764,6 +764,22 @@ buster.testCase("Mopidy", {
|
||||
this.mopidy._createApi({});
|
||||
|
||||
assert.calledOnceWith(spy);
|
||||
},
|
||||
|
||||
"creates methods that sends correct messages": function () {
|
||||
var sendStub = this.stub(this.mopidy, "_send");
|
||||
this.mopidy._createApi({
|
||||
foo: {
|
||||
params: ["bar", "baz"]
|
||||
}
|
||||
});
|
||||
|
||||
this.mopidy.foo(31, 97);
|
||||
|
||||
assert.calledOnceWith(sendStub, {
|
||||
method: "foo",
|
||||
params: [31, 97]
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user