Use const/let in specs, not var
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user