kopia lustrzana https://github.com/robhawkes/vizicities
Moved over existing tests to use `sinon-chai`
rodzic
0d70060cf2
commit
2c546e1a59
|
@ -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});
|
||||
});
|
||||
});
|
|
@ -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);
|
||||
});
|
||||
});
|
|
@ -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);
|
||||
});
|
||||
});
|
Ładowanie…
Reference in New Issue