Use const/let in specs, not var
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
(function(env) {
|
||||
function browserVersion(matchFn) {
|
||||
var userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||
const userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||
if (!userAgent) {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
var match = matchFn(userAgent);
|
||||
const match = matchFn(userAgent);
|
||||
|
||||
return match ? parseFloat(match[1]) : void 0;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
(function(env) {
|
||||
function domHelpers() {
|
||||
var doc;
|
||||
let doc;
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
doc = document;
|
||||
} else {
|
||||
var JSDOM = require('jsdom').JSDOM;
|
||||
var dom = new JSDOM();
|
||||
const JSDOM = require('jsdom').JSDOM;
|
||||
const dom = new JSDOM();
|
||||
doc = dom.window.document;
|
||||
}
|
||||
|
||||
return {
|
||||
document: doc,
|
||||
createElementWithClassName: function(className) {
|
||||
var el = this.document.createElement('div');
|
||||
const el = this.document.createElement('div');
|
||||
el.className = className;
|
||||
return el;
|
||||
}
|
||||
|
||||
@@ -4,22 +4,22 @@
|
||||
toHaveFailedExpectationsForRunnable: function() {
|
||||
return {
|
||||
compare: function(actual, fullName, expectedFailures) {
|
||||
var foundRunnable = false,
|
||||
let foundRunnable = false,
|
||||
expectations = true,
|
||||
foundFailures = [];
|
||||
for (var i = 0; i < actual.calls.count(); i++) {
|
||||
var args = actual.calls.argsFor(i)[0];
|
||||
for (let i = 0; i < actual.calls.count(); i++) {
|
||||
const args = actual.calls.argsFor(i)[0];
|
||||
|
||||
if (args.fullName === fullName) {
|
||||
foundRunnable = true;
|
||||
|
||||
for (var j = 0; j < args.failedExpectations.length; j++) {
|
||||
for (let j = 0; j < args.failedExpectations.length; j++) {
|
||||
foundFailures.push(args.failedExpectations[j].message);
|
||||
}
|
||||
|
||||
for (var j = 0; j < expectedFailures.length; j++) {
|
||||
var failure = foundFailures[j];
|
||||
var expectedFailure = expectedFailures[j];
|
||||
for (let j = 0; j < expectedFailures.length; j++) {
|
||||
const failure = foundFailures[j];
|
||||
const expectedFailure = expectedFailures[j];
|
||||
|
||||
if (
|
||||
Object.prototype.toString.call(expectedFailure) ===
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
(function() {
|
||||
var path = require('path'),
|
||||
const path = require('path'),
|
||||
glob = require('glob');
|
||||
|
||||
var jasmineUnderTestRequire = require(path.join(
|
||||
const jasmineUnderTestRequire = require(path.join(
|
||||
__dirname,
|
||||
'../../src/core/requireCore.js'
|
||||
));
|
||||
@@ -12,7 +12,7 @@
|
||||
};
|
||||
|
||||
function getSourceFiles() {
|
||||
var src_files = ['core/**/*.js', 'version.js'].map(function(file) {
|
||||
const src_files = ['core/**/*.js', 'version.js'].map(function(file) {
|
||||
return path.join(__dirname, '../../', 'src/', file);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user