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
+3 -3
View File
@@ -1,6 +1,6 @@
describe('Timer', function() {
it('reports the time elapsed', function() {
var fakeNow = jasmine.createSpy('fake Date.now'),
const fakeNow = jasmine.createSpy('fake Date.now'),
timer = new jasmineUnderTest.Timer({ now: fakeNow });
fakeNow.and.returnValue(100);
@@ -12,7 +12,7 @@ describe('Timer', function() {
});
describe('when date is stubbed, perhaps by other testing helpers', function() {
var origDate = Date;
const origDate = Date;
beforeEach(function() {
// eslint-disable-next-line no-implicit-globals
Date = jasmine.createSpy('date spy');
@@ -24,7 +24,7 @@ describe('Timer', function() {
});
it('does not throw even though Date was taken away', function() {
var timer = new jasmineUnderTest.Timer();
const timer = new jasmineUnderTest.Timer();
expect(timer.start).not.toThrow();
expect(timer.elapsed()).toEqual(jasmine.any(Number));