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,27 +1,25 @@
describe('toContain', function() {
it('delegates to jasmineUnderTest.matchersUtil.contains', function() {
var matchersUtil = {
const matchersUtil = {
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
},
matcher = jasmineUnderTest.matchers.toContain(matchersUtil),
result;
matcher = jasmineUnderTest.matchers.toContain(matchersUtil);
result = matcher.compare('ABC', 'B');
const result = matcher.compare('ABC', 'B');
expect(matchersUtil.contains).toHaveBeenCalledWith('ABC', 'B');
expect(result.pass).toBe(true);
});
it('works with custom equality testers', function() {
var tester = function(a, b) {
const tester = function(a, b) {
return a.toString() === b.toString();
},
matchersUtil = new jasmineUnderTest.MatchersUtil({
customTesters: [tester]
}),
matcher = jasmineUnderTest.matchers.toContain(matchersUtil),
result;
matcher = jasmineUnderTest.matchers.toContain(matchersUtil);
result = matcher.compare(['1', '2'], 2);
const result = matcher.compare(['1', '2'], 2);
expect(result.pass).toBe(true);
});
});