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,73 +1,73 @@
describe('Any', function() {
it('matches a string', function() {
var any = new jasmineUnderTest.Any(String);
const any = new jasmineUnderTest.Any(String);
expect(any.asymmetricMatch('foo')).toBe(true);
});
it('matches a number', function() {
var any = new jasmineUnderTest.Any(Number);
const any = new jasmineUnderTest.Any(Number);
expect(any.asymmetricMatch(1)).toBe(true);
});
it('matches a function', function() {
var any = new jasmineUnderTest.Any(Function);
const any = new jasmineUnderTest.Any(Function);
expect(any.asymmetricMatch(function() {})).toBe(true);
});
it('matches an Object', function() {
var any = new jasmineUnderTest.Any(Object);
const any = new jasmineUnderTest.Any(Object);
expect(any.asymmetricMatch({})).toBe(true);
});
it('matches a Boolean', function() {
var any = new jasmineUnderTest.Any(Boolean);
const any = new jasmineUnderTest.Any(Boolean);
expect(any.asymmetricMatch(true)).toBe(true);
});
it('matches a Map', function() {
var any = new jasmineUnderTest.Any(Map);
const any = new jasmineUnderTest.Any(Map);
expect(any.asymmetricMatch(new Map())).toBe(true);
});
it('matches a Set', function() {
var any = new jasmineUnderTest.Any(Set);
const any = new jasmineUnderTest.Any(Set);
expect(any.asymmetricMatch(new Set())).toBe(true);
});
it('matches a TypedArray', function() {
var any = new jasmineUnderTest.Any(Uint32Array);
const any = new jasmineUnderTest.Any(Uint32Array);
expect(any.asymmetricMatch(new Uint32Array([]))).toBe(true);
});
it('matches a Symbol', function() {
var any = new jasmineUnderTest.Any(Symbol);
const any = new jasmineUnderTest.Any(Symbol);
expect(any.asymmetricMatch(Symbol())).toBe(true);
});
it('matches another constructed object', function() {
var Thing = function() {},
const Thing = function() {},
any = new jasmineUnderTest.Any(Thing);
expect(any.asymmetricMatch(new Thing())).toBe(true);
});
it('does not treat null as an Object', function() {
var any = new jasmineUnderTest.Any(Object);
const any = new jasmineUnderTest.Any(Object);
expect(any.asymmetricMatch(null)).toBe(false);
});
it("jasmineToString's itself", function() {
var any = new jasmineUnderTest.Any(Number);
const any = new jasmineUnderTest.Any(Number);
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');