Use const/let in specs, not var

This commit is contained in:
Steve Gravrock
2022-04-16 13:41:44 -07:00
parent 482dc883eb
commit 1166d10e43
111 changed files with 2522 additions and 2675 deletions

View File

@@ -1,13 +1,13 @@
describe('Truthy', function() {
it('is true for a non empty string', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch('foo')).toBe(true);
expect(truthy.asymmetricMatch('')).toBe(false);
});
it('is true for a number that is not 0', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch(1)).toBe(true);
expect(truthy.asymmetricMatch(0)).toBe(false);
@@ -16,44 +16,44 @@ describe('Truthy', function() {
});
it('is true for a function', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch(function() {})).toBe(true);
});
it('is true for an Object', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch({})).toBe(true);
});
it('is true for a truthful Boolean', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch(true)).toBe(true);
expect(truthy.asymmetricMatch(false)).toBe(false);
});
it('is true for an empty object', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch({})).toBe(true);
});
it('is true for an empty array', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch([])).toBe(true);
});
it('is true for a date', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch(new Date())).toBe(true);
});
it('is true for a infiniti', function() {
var truthy = new jasmineUnderTest.Truthy();
const truthy = new jasmineUnderTest.Truthy();
expect(truthy.asymmetricMatch(Infinity)).toBe(true);
expect(truthy.asymmetricMatch(-Infinity)).toBe(true);