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,15 +1,15 @@
describe('MismatchTree', function () {
describe('#add', function () {
describe('When the path is empty', function () {
it('flags the root node as mismatched', function () {
describe('MismatchTree', function() {
describe('#add', function() {
describe('When the path is empty', function() {
it('flags the root node as mismatched', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath([]));
expect(tree.isMismatch).toBe(true);
});
});
describe('When the path is not empty', function () {
it('flags the node as mismatched', function () {
describe('When the path is not empty', function() {
it('flags the node as mismatched', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']));
@@ -17,7 +17,7 @@ describe('MismatchTree', function () {
expect(tree.child('a').child('b').isMismatch).toBe(true);
});
it('does not flag ancestors as mismatched', function () {
it('does not flag ancestors as mismatched', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']));
@@ -27,7 +27,7 @@ describe('MismatchTree', function () {
});
});
it('stores the formatter on only the target node', function () {
it('stores the formatter on only the target node', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']), formatter);
@@ -37,7 +37,7 @@ describe('MismatchTree', function () {
expect(tree.child('a').child('b').formatter).toBe(formatter);
});
it('stores the path to the node', function () {
it('stores the path to the node', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']), formatter);
@@ -46,8 +46,8 @@ describe('MismatchTree', function () {
});
});
describe('#traverse', function () {
it('calls the callback for all nodes that are or contain mismatches', function () {
describe('#traverse', function() {
it('calls the callback for all nodes that are or contain mismatches', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']), formatter);
tree.add(new jasmineUnderTest.ObjectPath(['c']));
@@ -56,20 +56,28 @@ describe('MismatchTree', function () {
tree.traverse(visit);
expect(visit).toHaveBeenCalledWith(
new jasmineUnderTest.ObjectPath([]), false, undefined
new jasmineUnderTest.ObjectPath([]),
false,
undefined
);
expect(visit).toHaveBeenCalledWith(
new jasmineUnderTest.ObjectPath(['a']), false, undefined
new jasmineUnderTest.ObjectPath(['a']),
false,
undefined
);
expect(visit).toHaveBeenCalledWith(
new jasmineUnderTest.ObjectPath(['a', 'b']), true, formatter
new jasmineUnderTest.ObjectPath(['a', 'b']),
true,
formatter
);
expect(visit).toHaveBeenCalledWith(
new jasmineUnderTest.ObjectPath(['c']), true, undefined
new jasmineUnderTest.ObjectPath(['c']),
true,
undefined
);
});
it('does not call the callback if there are no mismatches', function () {
it('does not call the callback if there are no mismatches', function() {
var tree = new jasmineUnderTest.MismatchTree();
var visit = jasmine.createSpy('visit');
@@ -78,12 +86,12 @@ describe('MismatchTree', function () {
expect(visit).not.toHaveBeenCalled();
});
it('visits parents before children', function () {
it('visits parents before children', function() {
var tree = new jasmineUnderTest.MismatchTree();
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']));
var visited = [];
tree.traverse(function (path) {
tree.traverse(function(path) {
visited.push(path);
return true;
});
@@ -101,7 +109,7 @@ describe('MismatchTree', function () {
tree.add(new jasmineUnderTest.ObjectPath([1]));
var visited = [];
tree.traverse(function (path) {
tree.traverse(function(path) {
visited.push(path);
return true;
});
@@ -118,7 +126,7 @@ describe('MismatchTree', function () {
tree.add(new jasmineUnderTest.ObjectPath(['a', 'b']));
var visited = [];
tree.traverse(function (path) {
tree.traverse(function(path) {
visited.push(path);
return path.depth() === 0;
});
@@ -130,7 +138,5 @@ describe('MismatchTree', function () {
});
});
function formatter() {
}
function formatter() {}
});