Run Prettier on all files
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
describe("toHaveBeenCalledTimes", function() {
|
||||
it("passes when the actual 0 matches the expected 0 ", function () {
|
||||
describe('toHaveBeenCalledTimes', function() {
|
||||
it('passes when the actual 0 matches the expected 0 ', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy'),
|
||||
result;
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy'),
|
||||
result;
|
||||
result = matcher.compare(calledSpy, 0);
|
||||
expect(result.pass).toBeTruthy();
|
||||
});
|
||||
it("passes when the actual matches the expected", function() {
|
||||
it('passes when the actual matches the expected', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy'),
|
||||
result;
|
||||
@@ -16,18 +16,20 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
expect(result.pass).toBe(true);
|
||||
});
|
||||
|
||||
it("fails when expected numbers is not supplied", function(){
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
it('fails when expected numbers is not supplied', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
spy = new jasmineUnderTest.Spy('spy'),
|
||||
result;
|
||||
|
||||
spy();
|
||||
expect(function() {
|
||||
matcher.compare(spy);
|
||||
}).toThrowError(/The expected times failed is a required argument and must be a number./);
|
||||
expect(function() {
|
||||
matcher.compare(spy);
|
||||
}).toThrowError(
|
||||
/The expected times failed is a required argument and must be a number./
|
||||
);
|
||||
});
|
||||
|
||||
it("fails when the actual was called less than the expected", function() {
|
||||
it('fails when the actual was called less than the expected', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
uncalledSpy = new jasmineUnderTest.Spy('uncalled spy'),
|
||||
result;
|
||||
@@ -36,7 +38,7 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
expect(result.pass).toBe(false);
|
||||
});
|
||||
|
||||
it("fails when the actual was called more than expected", function() {
|
||||
it('fails when the actual was called more than expected', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
uncalledSpy = new jasmineUnderTest.Spy('uncalled spy'),
|
||||
result;
|
||||
@@ -48,7 +50,7 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
expect(result.pass).toBe(false);
|
||||
});
|
||||
|
||||
it("throws an exception when the actual is not a spy", function() {
|
||||
it('throws an exception when the actual is not a spy', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
@@ -59,7 +61,7 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
}).toThrowError(/Expected a spy, but got Function./);
|
||||
});
|
||||
|
||||
it("has a custom message on failure that tells it was called only once", function() {
|
||||
it('has a custom message on failure that tells it was called only once', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
spy = new jasmineUnderTest.Spy('sample-spy'),
|
||||
result;
|
||||
@@ -69,10 +71,14 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
spy();
|
||||
|
||||
result = matcher.compare(spy, 1);
|
||||
expect(result.message).toEqual('Expected spy sample-spy to have been called once. It was called ' + 4 + ' times.');
|
||||
expect(result.message).toEqual(
|
||||
'Expected spy sample-spy to have been called once. It was called ' +
|
||||
4 +
|
||||
' times.'
|
||||
);
|
||||
});
|
||||
|
||||
it("has a custom message on failure that tells how many times it was called", function() {
|
||||
it('has a custom message on failure that tells how many times it was called', function() {
|
||||
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledTimes(),
|
||||
spy = new jasmineUnderTest.Spy('sample-spy'),
|
||||
result;
|
||||
@@ -82,7 +88,10 @@ describe("toHaveBeenCalledTimes", function() {
|
||||
spy();
|
||||
|
||||
result = matcher.compare(spy, 2);
|
||||
expect(result.message).toEqual('Expected spy sample-spy to have been called 2 times. It was called ' + 4 + ' times.');
|
||||
expect(result.message).toEqual(
|
||||
'Expected spy sample-spy to have been called 2 times. It was called ' +
|
||||
4 +
|
||||
' times.'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user