Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved over existing tests to use `sinon-chai`

  • Loading branch information...
commit 2c546e1a59683c852f029ab20dd24905c2074aef 1 parent 0d70060
@matthojo matthojo authored
Showing with 6 additions and 8 deletions.
  1. +2 −4 test/spec/Log.js
  2. +3 −3 test/spec/Loop.js
  3. +1 −1  test/spec/Mediator.js
View
6 test/spec/Log.js
@@ -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});
});
});
View
6 test/spec/Loop.js
@@ -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);
});
});
View
2  test/spec/Mediator.js
@@ -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);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.