Use const/let in specs, not var
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
describe('toBePending', function() {
|
||||
it('passes if the actual promise is pending', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
|
||||
actual = new Promise(function() {});
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('toBePending', function() {
|
||||
});
|
||||
|
||||
it('fails if the actual promise is resolved', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
|
||||
actual = Promise.resolve();
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('toBePending', function() {
|
||||
});
|
||||
|
||||
it('fails if the actual promise is rejected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
|
||||
actual = Promise.reject(new Error('promise was rejected'));
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('toBePending', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBePending(matchersUtil),
|
||||
actual = 'not a promise';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('toBeRejected', function() {
|
||||
it('passes if the actual is rejected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejected(matchersUtil),
|
||||
actual = Promise.reject('AsyncExpectationSpec rejection');
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('toBeRejected', function() {
|
||||
});
|
||||
|
||||
it('fails if the actual is resolved', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejected(matchersUtil),
|
||||
actual = Promise.resolve();
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('toBeRejected', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejected(matchersUtil),
|
||||
actual = 'not a promise';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('#toBeRejectedWithError', function() {
|
||||
it('passes when Error type matches', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -20,7 +20,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when Error type and message matches', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -40,7 +40,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when Error matches and is exactly Error', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -60,7 +60,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when Error message matches a string', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -80,7 +80,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when Error message matches a RegExp', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -100,7 +100,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when Error message is empty', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -120,7 +120,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('passes when no arguments', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -140,7 +140,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('fails when resolved', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -159,7 +159,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('fails when rejected with non Error type', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -179,7 +179,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('fails when Error type mismatches', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -199,7 +199,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('fails when Error message mismatches', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
@@ -219,7 +219,7 @@ describe('#toBeRejectedWithError', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWithError(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('#toBeRejectedWith', function() {
|
||||
it('should return true if the promise is rejected with the expected value', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWith(matchersUtil),
|
||||
actual = Promise.reject({ error: 'PEBCAK' });
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('#toBeRejectedWith', function() {
|
||||
});
|
||||
|
||||
it('should fail if the promise resolves', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWith(matchersUtil),
|
||||
actual = Promise.resolve();
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('#toBeRejectedWith', function() {
|
||||
});
|
||||
|
||||
it('should fail if the promise is rejected with a different value', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWith(matchersUtil),
|
||||
@@ -38,7 +38,7 @@ describe('#toBeRejectedWith', function() {
|
||||
});
|
||||
|
||||
it('should build its error correctly when negated', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWith(matchersUtil),
|
||||
@@ -55,7 +55,7 @@ describe('#toBeRejectedWith', function() {
|
||||
});
|
||||
|
||||
it('should support custom equality testers', function() {
|
||||
var customEqualityTesters = [
|
||||
const customEqualityTesters = [
|
||||
function() {
|
||||
return true;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ describe('#toBeRejectedWith', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeRejectedWith(matchersUtil),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('toBeResolved', function() {
|
||||
it('passes if the actual is resolved', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolved(matchersUtil),
|
||||
actual = Promise.resolve();
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('toBeResolved', function() {
|
||||
});
|
||||
|
||||
it('fails if the actual is rejected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter([])
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolved(matchersUtil),
|
||||
@@ -27,7 +27,7 @@ describe('toBeResolved', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolved(matchersUtil),
|
||||
actual = 'not a promise';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
describe('#toBeResolvedTo', function() {
|
||||
it('passes if the promise is resolved to the expected value', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil(),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
|
||||
actual = Promise.resolve({ foo: 42 });
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('#toBeResolvedTo', function() {
|
||||
});
|
||||
|
||||
it('fails if the promise is rejected', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
|
||||
@@ -29,7 +29,7 @@ describe('#toBeResolvedTo', function() {
|
||||
});
|
||||
|
||||
it('fails if the promise is resolved to a different value', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
|
||||
@@ -47,7 +47,7 @@ describe('#toBeResolvedTo', function() {
|
||||
});
|
||||
|
||||
it('builds its message correctly when negated', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
|
||||
@@ -64,7 +64,7 @@ describe('#toBeResolvedTo', function() {
|
||||
});
|
||||
|
||||
it('supports custom equality testers', function() {
|
||||
var customEqualityTesters = [
|
||||
const customEqualityTesters = [
|
||||
function() {
|
||||
return true;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ describe('#toBeResolvedTo', function() {
|
||||
});
|
||||
|
||||
it('fails if actual is not a promise', function() {
|
||||
var matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
const matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
matcher = jasmineUnderTest.asyncMatchers.toBeResolvedTo(matchersUtil),
|
||||
|
||||
Reference in New Issue
Block a user