Run Prettier on all files

This commit is contained in:
Steve Gravrock
2020-09-29 18:05:38 -07:00
parent 7d5ca27b9d
commit d27bb8fa96
108 changed files with 4399 additions and 2926 deletions

View File

@@ -1,16 +1,18 @@
describe("toThrowMatching", function() {
it("throws an error when the actual is not a function", function() {
describe('toThrowMatching', function() {
it('throws an error when the actual is not a function', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching();
expect(function() {
matcher.compare({}, function() { return true; });
matcher.compare({}, function() {
return true;
});
}).toThrowError(/Actual is not a Function/);
});
it("throws an error when the expected is not a function", function() {
it('throws an error when the expected is not a function', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching(),
fn = function() {
throw new Error("foo");
throw new Error('foo');
};
expect(function() {
@@ -18,20 +20,22 @@ describe("toThrowMatching", function() {
}).toThrowError(/Predicate is not a Function/);
});
it("fails if actual does not throw at all", function() {
it('fails if actual does not throw at all', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching(),
fn = function() {
return true;
},
result;
result = matcher.compare(fn, function() { return true; });
result = matcher.compare(fn, function() {
return true;
});
expect(result.pass).toBe(false);
expect(result.message).toEqual("Expected function to throw an exception.");
expect(result.message).toEqual('Expected function to throw an exception.');
});
it("fails with the correct message if thrown is a falsy value", function() {
it('fails with the correct message if thrown is a falsy value', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching({
pp: jasmineUnderTest.makePrettyPrinter()
}),
@@ -40,38 +44,50 @@ describe("toThrowMatching", function() {
},
result;
result = matcher.compare(fn, function() { return false; });
result = matcher.compare(fn, function() {
return false;
});
expect(result.pass).toBe(false);
expect(result.message()).toEqual("Expected function to throw an exception matching a predicate, but it threw undefined.");
expect(result.message()).toEqual(
'Expected function to throw an exception matching a predicate, but it threw undefined.'
);
});
it("passes if the argument is a function that returns true when called with the error", function() {
it('passes if the argument is a function that returns true when called with the error', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching(),
predicate = function(e) { return e.message === "nope" },
predicate = function(e) {
return e.message === 'nope';
},
fn = function() {
throw new TypeError("nope");
throw new TypeError('nope');
},
result;
result = matcher.compare(fn, predicate);
expect(result.pass).toBe(true);
expect(result.message).toEqual("Expected function not to throw an exception matching a predicate.");
expect(result.message).toEqual(
'Expected function not to throw an exception matching a predicate.'
);
});
it("fails if the argument is a function that returns false when called with the error", function() {
it('fails if the argument is a function that returns false when called with the error', function() {
var matcher = jasmineUnderTest.matchers.toThrowMatching({
pp: jasmineUnderTest.makePrettyPrinter()
}),
predicate = function(e) { return e.message === "oh no" },
predicate = function(e) {
return e.message === 'oh no';
},
fn = function() {
throw new TypeError("nope");
throw new TypeError('nope');
},
result;
result = matcher.compare(fn, predicate);
expect(result.pass).toBe(false);
expect(result.message()).toEqual("Expected function to throw an exception matching a predicate, but it threw TypeError with message 'nope'.");
expect(result.message()).toEqual(
"Expected function to throw an exception matching a predicate, but it threw TypeError with message 'nope'."
);
});
});