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,12 +1,12 @@
describe('ArrayContaining', function() {
it('matches any actual to an empty array', function() {
var containing = new jasmineUnderTest.ArrayContaining([]);
const containing = new jasmineUnderTest.ArrayContaining([]);
expect(containing.asymmetricMatch('foo')).toBe(true);
});
it('does not work when not passed an array', function() {
var containing = new jasmineUnderTest.ArrayContaining('foo');
const containing = new jasmineUnderTest.ArrayContaining('foo');
expect(function() {
containing.asymmetricMatch([]);
@@ -14,35 +14,35 @@ describe('ArrayContaining', function() {
});
it('matches when the item is in the actual', function() {
var containing = new jasmineUnderTest.ArrayContaining(['foo']);
var matchersUtil = new jasmineUnderTest.MatchersUtil();
const containing = new jasmineUnderTest.ArrayContaining(['foo']);
const matchersUtil = new jasmineUnderTest.MatchersUtil();
expect(containing.asymmetricMatch(['foo'], matchersUtil)).toBe(true);
});
it('matches when additional items are in the actual', function() {
var containing = new jasmineUnderTest.ArrayContaining(['foo']);
var matchersUtil = new jasmineUnderTest.MatchersUtil();
const containing = new jasmineUnderTest.ArrayContaining(['foo']);
const matchersUtil = new jasmineUnderTest.MatchersUtil();
expect(containing.asymmetricMatch(['foo', 'bar'], matchersUtil)).toBe(true);
});
it('does not match when the item is not in the actual', function() {
var containing = new jasmineUnderTest.ArrayContaining(['foo']);
var matchersUtil = new jasmineUnderTest.MatchersUtil();
const containing = new jasmineUnderTest.ArrayContaining(['foo']);
const matchersUtil = new jasmineUnderTest.MatchersUtil();
expect(containing.asymmetricMatch(['bar'], matchersUtil)).toBe(false);
});
it('does not match when the actual is not an array', function() {
var containing = new jasmineUnderTest.ArrayContaining(['foo']);
var matchersUtil = new jasmineUnderTest.MatchersUtil();
const containing = new jasmineUnderTest.ArrayContaining(['foo']);
const matchersUtil = new jasmineUnderTest.MatchersUtil();
expect(containing.asymmetricMatch('foo', matchersUtil)).toBe(false);
});
it('jasmineToStrings itself', function() {
var sample = [],
const sample = [],
matcher = new jasmineUnderTest.ArrayContaining(sample),
pp = jasmine.createSpy('pp').and.returnValue('sample');
@@ -53,7 +53,7 @@ describe('ArrayContaining', function() {
});
it('uses custom equality testers', function() {
var tester = function(a, b) {
const tester = function(a, b) {
// All "foo*" strings match each other.
if (
typeof a == 'string' &&
@@ -64,8 +64,8 @@ describe('ArrayContaining', function() {
return true;
}
};
var containing = new jasmineUnderTest.ArrayContaining(['fooVal']);
var matchersUtil = new jasmineUnderTest.MatchersUtil({
const containing = new jasmineUnderTest.ArrayContaining(['fooVal']);
const matchersUtil = new jasmineUnderTest.MatchersUtil({
customTesters: [tester]
});