Moved over existing tests to use `sinon-chai`

0.1
Matthew Harrison-Jones 2014-02-09 19:45:04 +00:00
rodzic 0d70060cf2
commit 2c546e1a59
3 zmienionych plików z 6 dodań i 8 usunięć

Wyświetl plik

@ -17,14 +17,12 @@ describe("Log", function() {
it("runs `Log` function", function() {
VIZI.Log("arg1", "arg2", "arg3");
assert.equal(spy.called, true);
expect(spy).to.have.been.called;
});
it("accepts and sets arguments correctly", function() {
VIZI.Log("arg1", 2, {"arg": 3});
assert.deepEqual(spy.args[0], ["arg1", 2, {"arg": 3}]);
expect(spy).to.have.been.calledWithExactly("arg1", 2, {"arg": 3});
});
});

Wyświetl plik

@ -26,7 +26,7 @@ describe("Loop", function() {
loop.stop(); // Stop default loop
loop.start();
assert.equal(spy.called, true);
expect(spy).to.have.been.called;
assert.equal(loop.stopLoop, false);
loop.stop();
@ -37,7 +37,7 @@ describe("Loop", function() {
loop.start();
loop.stop();
assert.equal(spy.called, true);
expect(spy).to.have.been.called;
});
it("stops loop", function() {
@ -45,7 +45,7 @@ describe("Loop", function() {
loop.start();
loop.stop();
assert.equal(spy.called, true);
expect(spy).to.have.been.called;
assert.equal(loop.stopLoop, true);
});
});

Wyświetl plik

@ -19,6 +19,6 @@ describe("Mediator", function() {
VIZI.Mediator.subscribe("test_topic", spy);
VIZI.Mediator.publish("test_topic", message);
assert.equal(message, spy.args[0][0]);
expect(spy).to.have.been.calledWith(message);
});
});