Merge branch 'FelixRilling-boolean-matcher'

- Merges #1679 from @FelixRilling
This commit is contained in:
Gregg Van Hove
2019-04-15 17:47:58 -07:00
6 changed files with 128 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
describe("toBeFalse", function() {
it("passes for false", function() {
var matcher = jasmineUnderTest.matchers.toBeFalse(),
result;
result = matcher.compare(false);
expect(result.pass).toBe(true);
});
it("fails for non-false", function() {
var matcher = jasmineUnderTest.matchers.toBeFalse(),
result;
result = matcher.compare('foo');
expect(result.pass).toBe(false);
});
it("fails for falsy", function() {
var matcher = jasmineUnderTest.matchers.toBeFalse(),
result;
result = matcher.compare(undefined);
expect(result.pass).toBe(false);
});
});

View File

@@ -0,0 +1,17 @@
describe("toBeTrue", function() {
it("passes for true", function() {
var matcher = jasmineUnderTest.matchers.toBeTrue(),
result;
result = matcher.compare(true);
expect(result.pass).toBe(true);
});
it("fails for non-true", function() {
var matcher = jasmineUnderTest.matchers.toBeTrue(),
result;
result = matcher.compare('foo');
expect(result.pass).toBe(false);
});
});