From 9ed17b222aaa2c060b53132a6882df9f15eaa3ae Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 17 Jun 2014 20:26:45 +0200 Subject: [PATCH] js: Test existing call convention --- js/test/mopidy-test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/test/mopidy-test.js b/js/test/mopidy-test.js index 4485bc32..781c24d2 100644 --- a/js/test/mopidy-test.js +++ b/js/test/mopidy-test.js @@ -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] + }); } } });