Skip to content

Commit

Permalink
using more explicit assertions (#2221)
Browse files Browse the repository at this point in the history
fearphage authored Feb 18, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9d4a01b commit 7498f1a
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions test/fake-test.js
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ describe("fake", function() {
assert.equals(f.firstArg, 46);

f(false, true, 47, "string");
assert.equals(f.firstArg, false);
assert.isFalse(f.firstArg);

f("string", false, true, 47);
assert.equals(f.firstArg, "string");
@@ -156,7 +156,7 @@ describe("fake", function() {
assert.equals(f.firstArg, 47);

f(true, 47, "string", false);
assert.equals(f.firstArg, true);
assert.isTrue(f.firstArg);

f();
assert.isUndefined(f.firstArg);
@@ -182,10 +182,10 @@ describe("fake", function() {
assert.equals(f.lastArg, 47);

f(47, "string", false, true);
assert.equals(f.lastArg, true);
assert.isTrue(f.lastArg);

f(true, 47, "string", false);
assert.equals(f.lastArg, false);
assert.isFalse(f.lastArg);

f();
assert.isUndefined(f.lastArg);
2 changes: 1 addition & 1 deletion test/issues/issues-test.js
Original file line number Diff line number Diff line change
@@ -612,7 +612,7 @@ describe("issues", function() {

fake(99, false);

assert.equals(fake.lastArg, false);
assert.isFalse(fake.lastArg);
});
});

22 changes: 11 additions & 11 deletions test/proxy-call-test.js
Original file line number Diff line number Diff line change
@@ -180,19 +180,19 @@ describe("sinonSpy.call", function() {
return spy.getCall(idx);
});

assert.equals(calls[1].calledBefore(calls[3]), true);
assert.equals(calls[1].calledBefore(calls[0]), false);
assert.isTrue(calls[1].calledBefore(calls[3]));
assert.isFalse(calls[1].calledBefore(calls[0]));

assert.equals(calls[3].calledAfter(calls[1]), true);
assert.equals(calls[1].calledAfter(calls[3]), false);
assert.isTrue(calls[3].calledAfter(calls[1]));
assert.isFalse(calls[1].calledAfter(calls[3]));

assert.equals(calls[0].calledImmediatelyBefore(calls[2]), false);
assert.equals(calls[1].calledImmediatelyBefore(calls[2]), true);
assert.equals(calls[3].calledImmediatelyBefore(calls[1]), false);
assert.isFalse(calls[0].calledImmediatelyBefore(calls[2]));
assert.isTrue(calls[1].calledImmediatelyBefore(calls[2]));
assert.isFalse(calls[3].calledImmediatelyBefore(calls[1]));

assert.equals(calls[3].calledImmediatelyAfter(calls[1]), false);
assert.equals(calls[2].calledImmediatelyAfter(calls[1]), true);
assert.equals(calls[1].calledImmediatelyAfter(calls[3]), false);
assert.isFalse(calls[3].calledImmediatelyAfter(calls[1]));
assert.isTrue(calls[2].calledImmediatelyAfter(calls[1]));
assert.isFalse(calls[1].calledImmediatelyAfter(calls[3]));
});
});

@@ -566,7 +566,7 @@ describe("sinonSpy.call", function() {
assert.equals(spy.getCall(2).firstArg, 46);

spy();
assert.equals(spy.getCall(3).firstArg, undefined);
assert.isUndefined(spy.getCall(3).firstArg);
});
});

0 comments on commit 7498f1a

Please sign in to comment.