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,5 +1,5 @@
describe('Default Spy Strategy (Integration)', function() {
var env;
let env;
beforeEach(function() {
env = new jasmineUnderTest.Env();
@@ -19,13 +19,13 @@ describe('Default Spy Strategy (Integration)', function() {
});
env.it('spec in suite', function() {
var spy = env.createSpy('something');
const spy = env.createSpy('something');
expect(spy()).toBe(42);
});
});
env.it('spec not in suite', function() {
var spy = env.createSpy('something');
const spy = env.createSpy('something');
expect(spy()).toBeUndefined();
});
@@ -35,17 +35,17 @@ describe('Default Spy Strategy (Integration)', function() {
it('uses the default spy strategy defined when the spy is created', async function() {
env.it('spec', function() {
var a = env.createSpy('a');
const a = env.createSpy('a');
env.setDefaultSpyStrategy(function(and) {
and.returnValue(42);
});
var b = env.createSpy('b');
const b = env.createSpy('b');
env.setDefaultSpyStrategy(function(and) {
and.stub();
});
var c = env.createSpy('c');
const c = env.createSpy('c');
env.setDefaultSpyStrategy();
var d = env.createSpy('d');
const d = env.createSpy('d');
expect(a()).toBeUndefined();
expect(b()).toBe(42);