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,14 +1,16 @@
describe("Custom object formatters", function() {
describe('Custom object formatters', function() {
var env;
beforeEach(function() {
env = new jasmineUnderTest.Env();
env.configure({random: false});
env.configure({ random: false });
});
it("scopes custom object formatters to a spec", function(done) {
it('scopes custom object formatters to a spec', function(done) {
env.it('a spec with custom pretty-printer', function() {
env.addCustomObjectFormatter(function(obj) { return 'custom(' + obj + ')'; });
env.addCustomObjectFormatter(function(obj) {
return 'custom(' + obj + ')';
});
env.expect(42).toBeUndefined();
});
@@ -21,23 +23,29 @@ describe("Custom object formatters", function() {
specResults.push(result);
};
var expectations = function() {
expect(specResults[0].failedExpectations[0].message).toEqual("Expected custom(42) to be undefined.");
expect(specResults[1].failedExpectations[0].message).toEqual("Expected 42 to be undefined.");
expect(specResults[0].failedExpectations[0].message).toEqual(
'Expected custom(42) to be undefined.'
);
expect(specResults[1].failedExpectations[0].message).toEqual(
'Expected 42 to be undefined.'
);
done();
};
env.addReporter({ specDone:specDone });
env.addReporter({ specDone: specDone });
env.execute(null, expectations);
});
it("scopes custom object formatters to a suite", function(done) {
it('scopes custom object formatters to a suite', function(done) {
env.it('a spec without custom pretty-printer', function() {
env.expect(42).toBeUndefined();
});
env.describe('with custom pretty-printer', function() {
env.beforeEach(function() {
env.addCustomObjectFormatter(function(obj) { return 'custom(' + obj + ')'; });
env.addCustomObjectFormatter(function(obj) {
return 'custom(' + obj + ')';
});
});
env.it('a spec', function() {
@@ -50,18 +58,24 @@ describe("Custom object formatters", function() {
specResults.push(result);
};
var expectations = function() {
expect(specResults[0].failedExpectations[0].message).toEqual("Expected 42 to be undefined.");
expect(specResults[1].failedExpectations[0].message).toEqual("Expected custom(42) to be undefined.");
expect(specResults[0].failedExpectations[0].message).toEqual(
'Expected 42 to be undefined.'
);
expect(specResults[1].failedExpectations[0].message).toEqual(
'Expected custom(42) to be undefined.'
);
done();
};
env.addReporter({ specDone:specDone });
env.addReporter({ specDone: specDone });
env.execute(null, expectations);
});
it("throws an exception if you try to add a custom object formatter outside a runable", function() {
it('throws an exception if you try to add a custom object formatter outside a runable', function() {
expect(function() {
env.addCustomObjectFormatter(function() {});
}).toThrowError('Custom object formatters must be added in a before function or a spec')
}).toThrowError(
'Custom object formatters must be added in a before function or a spec'
);
});
});