Run Prettier on all files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
describe("toBe", function() {
|
||||
it("passes with no message when actual === expected", function() {
|
||||
describe('toBe', function() {
|
||||
it('passes with no message when actual === expected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result;
|
||||
@@ -8,29 +8,37 @@ describe("toBe", function() {
|
||||
expect(result.pass).toBe(true);
|
||||
});
|
||||
|
||||
it("passes with a custom message when expected is an array", function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
it('passes with a custom message when expected is an array', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result,
|
||||
array = [1];
|
||||
|
||||
result = matcher.compare(array, array);
|
||||
expect(result.pass).toBe(true);
|
||||
expect(result.message).toBe("Expected [ 1 ] not to be [ 1 ]. Tip: To check for deep equality, use .toEqual() instead of .toBe().")
|
||||
expect(result.message).toBe(
|
||||
'Expected [ 1 ] not to be [ 1 ]. Tip: To check for deep equality, use .toEqual() instead of .toBe().'
|
||||
);
|
||||
});
|
||||
|
||||
it("passes with a custom message when expected is an object", function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
it('passes with a custom message when expected is an object', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result,
|
||||
obj = {foo: "bar"};
|
||||
obj = { foo: 'bar' };
|
||||
|
||||
result = matcher.compare(obj, obj);
|
||||
expect(result.pass).toBe(true);
|
||||
expect(result.message).toBe("Expected Object({ foo: 'bar' }) not to be Object({ foo: 'bar' }). Tip: To check for deep equality, use .toEqual() instead of .toBe().")
|
||||
expect(result.message).toBe(
|
||||
"Expected Object({ foo: 'bar' }) not to be Object({ foo: 'bar' }). Tip: To check for deep equality, use .toEqual() instead of .toBe()."
|
||||
);
|
||||
});
|
||||
|
||||
it("fails with no message when actual !== expected", function() {
|
||||
it('fails with no message when actual !== expected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result;
|
||||
@@ -40,35 +48,47 @@ describe("toBe", function() {
|
||||
expect(result.message).toBeUndefined();
|
||||
});
|
||||
|
||||
it("fails with a custom message when expected is an array", function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
it('fails with a custom message when expected is an array', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result;
|
||||
|
||||
result = matcher.compare([1], [1]);
|
||||
expect(result.pass).toBe(false);
|
||||
expect(result.message).toBe("Expected [ 1 ] to be [ 1 ]. Tip: To check for deep equality, use .toEqual() instead of .toBe().")
|
||||
expect(result.message).toBe(
|
||||
'Expected [ 1 ] to be [ 1 ]. Tip: To check for deep equality, use .toEqual() instead of .toBe().'
|
||||
);
|
||||
});
|
||||
|
||||
it("fails with a custom message when expected is an object", function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({pp: jasmineUnderTest.makePrettyPrinter()}),
|
||||
it('fails with a custom message when expected is an object', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result;
|
||||
|
||||
result = matcher.compare({foo: "bar"}, {foo: "bar"});
|
||||
result = matcher.compare({ foo: 'bar' }, { foo: 'bar' });
|
||||
expect(result.pass).toBe(false);
|
||||
expect(result.message).toBe("Expected Object({ foo: 'bar' }) to be Object({ foo: 'bar' }). Tip: To check for deep equality, use .toEqual() instead of .toBe().")
|
||||
expect(result.message).toBe(
|
||||
"Expected Object({ foo: 'bar' }) to be Object({ foo: 'bar' }). Tip: To check for deep equality, use .toEqual() instead of .toBe()."
|
||||
);
|
||||
});
|
||||
|
||||
it("works with custom object formatters when expected is an object", function() {
|
||||
var formatter = function(x) { return '<' + x.foo + '>'; },
|
||||
it('works with custom object formatters when expected is an object', function() {
|
||||
var formatter = function(x) {
|
||||
return '<' + x.foo + '>';
|
||||
},
|
||||
prettyPrinter = jasmineUnderTest.makePrettyPrinter([formatter]),
|
||||
matchersUtil = new jasmineUnderTest.MatchersUtil({pp: prettyPrinter}),
|
||||
matchersUtil = new jasmineUnderTest.MatchersUtil({ pp: prettyPrinter }),
|
||||
matcher = jasmineUnderTest.matchers.toBe(matchersUtil),
|
||||
result;
|
||||
|
||||
result = matcher.compare({foo: "bar"}, {foo: "bar"});
|
||||
result = matcher.compare({ foo: 'bar' }, { foo: 'bar' });
|
||||
expect(result.pass).toBe(false);
|
||||
expect(result.message).toBe("Expected <bar> to be <bar>. Tip: To check for deep equality, use .toEqual() instead of .toBe().")
|
||||
expect(result.message).toBe(
|
||||
'Expected <bar> to be <bar>. Tip: To check for deep equality, use .toEqual() instead of .toBe().'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user