diff --git a/.eslintrc-base.json b/.eslintrc-base.json
index a22993a7761f..ee3a411bb2d7 100644
--- a/.eslintrc-base.json
+++ b/.eslintrc-base.json
@@ -104,6 +104,7 @@
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
+ "quotes": ["error", "single"],
"semi-spacing": "error",
"semi": "error",
"space-before-blocks": ["error", "always"],
diff --git a/.eslintrc-todo.json b/.eslintrc-todo.json
index a80e6722b527..7e89110084b7 100644
--- a/.eslintrc-todo.json
+++ b/.eslintrc-todo.json
@@ -20,7 +20,6 @@
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
- "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}],
- "quotes": ["error", "single"]
+ "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}]
}
}
diff --git a/Gruntfile.js b/Gruntfile.js
index bf4b1470d621..5b31c8ea24be 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -205,7 +205,7 @@ module.exports = function(grunt) {
dest: 'build/angular-parse-ext.js',
src: util.wrap(files['angularModules']['ngParseExt'], 'module')
},
- "promises-aplus-adapter": {
+ 'promises-aplus-adapter': {
dest:'tmp/promises-aplus-adapter++.js',
src:['src/ng/q.js', 'lib/promises-aplus/promises-aplus-test-adapter.js']
}
diff --git a/angularFiles.js b/angularFiles.js
index cde1a9c1eccb..4769808ad391 100755
--- a/angularFiles.js
+++ b/angularFiles.js
@@ -209,7 +209,7 @@ var angularFiles = {
'build/docs/docs-scenario.js'
],
- "karmaModules": [
+ 'karmaModules': [
'build/angular.js',
'@angularSrcModules',
'test/modules/no_bootstrap.js',
diff --git a/benchmarks/ng-options-bp/app.js b/benchmarks/ng-options-bp/app.js
index 2447b8738241..01b70009bf4a 100755
--- a/benchmarks/ng-options-bp/app.js
+++ b/benchmarks/ng-options-bp/app.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
/* globals angular, benchmarkSteps */
diff --git a/benchmarks/orderby-bp/bp.conf.js b/benchmarks/orderby-bp/bp.conf.js
index 5fe179be8623..95e53709338f 100644
--- a/benchmarks/orderby-bp/bp.conf.js
+++ b/benchmarks/orderby-bp/bp.conf.js
@@ -6,8 +6,8 @@ module.exports = function(config) {
config.set({
scripts: [
{
- "id": "jquery",
- "src": "jquery-noop.js"
+ 'id': 'jquery',
+ 'src': 'jquery-noop.js'
}, {
id: 'angular',
src: '/build/angular.js'
diff --git a/benchmarks/select-ng-value-bp/app.js b/benchmarks/select-ng-value-bp/app.js
index ef53b3c00c94..de19c14c6a26 100755
--- a/benchmarks/select-ng-value-bp/app.js
+++ b/benchmarks/select-ng-value-bp/app.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
/* globals angular, benchmarkSteps */
diff --git a/changelog.js b/changelog.js
index e33bb20747ed..ccaae08d9df3 100755
--- a/changelog.js
+++ b/changelog.js
@@ -160,7 +160,7 @@ var writeChangelog = function(stream, commits, version) {
if (commit.breaking) {
sections.breaks[component] = sections.breaks[component] || [];
sections.breaks[component].push({
- subject: util.format("due to %s,\n %s", linkToCommit(commit.hash), commit.breaking),
+ subject: util.format('due to %s,\n %s', linkToCommit(commit.hash), commit.breaking),
hash: commit.hash,
closes: []
});
diff --git a/docs/app/e2e/api-docs/api-pages.scenario.js b/docs/app/e2e/api-docs/api-pages.scenario.js
index f30e4d1cffa7..f6f296fd759a 100644
--- a/docs/app/e2e/api-docs/api-pages.scenario.js
+++ b/docs/app/e2e/api-docs/api-pages.scenario.js
@@ -1,10 +1,10 @@
'use strict';
-describe("doc.angularjs.org", function() {
+describe('doc.angularjs.org', function() {
- describe("API pages", function() {
+ describe('API pages', function() {
- it("should display links to code on GitHub", function() {
+ it('should display links to code on GitHub', function() {
browser.get('build/docs/index.html#!/api/ng/service/$http');
expect(element(by.css('.improve-docs')).getAttribute('href')).toMatch(/https?:\/\/github\.com\/angular\/angular\.js\/edit\/.+\/src\/ng\/http\.js/);
@@ -38,7 +38,7 @@ describe("doc.angularjs.org", function() {
expect(code.getText()).toContain('guest!!!');
});
- it("should trim indentation from code blocks", function() {
+ it('should trim indentation from code blocks', function() {
browser.get('build/docs/index.html#!/api/ng/type/$rootScope.Scope');
var codeBlocks = element.all(by.css('pre > code.lang-js'));
diff --git a/docs/app/e2e/api-docs/provider-pages.scenario.js b/docs/app/e2e/api-docs/provider-pages.scenario.js
index b83af4614d18..c0d5e95976f9 100644
--- a/docs/app/e2e/api-docs/provider-pages.scenario.js
+++ b/docs/app/e2e/api-docs/provider-pages.scenario.js
@@ -1,8 +1,8 @@
'use strict';
-describe("provider pages", function() {
+describe('provider pages', function() {
- it("should show the related service", function() {
+ it('should show the related service', function() {
browser.get('build/docs/index.html#!/api/ng/provider/$compileProvider');
var serviceLink = element.all(by.css('ol.api-profile-header-structure li a')).first();
expect(serviceLink.getText()).toEqual('- $compile');
diff --git a/docs/app/e2e/api-docs/service-pages.scenario.js b/docs/app/e2e/api-docs/service-pages.scenario.js
index b63c7320e5c8..8b55169cf6d9 100644
--- a/docs/app/e2e/api-docs/service-pages.scenario.js
+++ b/docs/app/e2e/api-docs/service-pages.scenario.js
@@ -1,8 +1,8 @@
'use strict';
-describe("service pages", function() {
+describe('service pages', function() {
- it("should show the related provider if there is one", function() {
+ it('should show the related provider if there is one', function() {
browser.get('build/docs/index.html#!/api/ng/service/$compile');
var providerLink = element.all(by.css('ol.api-profile-header-structure li a')).first();
expect(providerLink.getText()).toEqual('- $compileProvider');
@@ -14,7 +14,7 @@ describe("service pages", function() {
expect(providerLink.getAttribute('href')).not.toMatch(/api\/ng\/provider\/\$compileProvider/);
});
- it("should show parameter defaults", function() {
+ it('should show parameter defaults', function() {
browser.get('build/docs/index.html#!/api/ng/service/$timeout');
expect(element.all(by.css('.input-arguments p em')).first().getText()).toContain('(default: 0)');
});
diff --git a/docs/app/e2e/app.scenario.js b/docs/app/e2e/app.scenario.js
index e8e675328845..829323bb6115 100644
--- a/docs/app/e2e/app.scenario.js
+++ b/docs/app/e2e/app.scenario.js
@@ -73,10 +73,10 @@ describe('docs.angularjs.org', function() {
it('should display formatted error messages on error doc pages', function() {
browser.get('build/docs/index-production.html#!error/ng/areq?p0=Missing&p1=not%20a%20function,%20got%20undefined');
- expect(element(by.css('.minerr-errmsg')).getText()).toEqual("Argument 'Missing' is not a function, got undefined");
+ expect(element(by.css('.minerr-errmsg')).getText()).toEqual('Argument \'Missing\' is not a function, got undefined');
});
- it("should display an error if the page does not exist", function() {
+ it('should display an error if the page does not exist', function() {
browser.get('build/docs/index-production.html#!/api/does/not/exist');
expect(element(by.css('h1')).getText()).toBe('Oops!');
});
diff --git a/docs/app/src/docs.js b/docs/app/src/docs.js
index fb6a35565e8c..3593009b653b 100644
--- a/docs/app/src/docs.js
+++ b/docs/app/src/docs.js
@@ -54,7 +54,7 @@ angular.module('DocsController', [])
***********************************/
$scope.versionNumber = angular.version.full;
- $scope.version = angular.version.full + " " + angular.version.codeName;
+ $scope.version = angular.version.full + ' ' + angular.version.codeName;
$scope.loading = 0;
diff --git a/docs/app/src/examples.js b/docs/app/src/examples.js
index b6e8d5760256..fca74d9fc21a 100644
--- a/docs/app/src/examples.js
+++ b/docs/app/src/examples.js
@@ -138,8 +138,8 @@ angular.module('examples', [])
var newWindow = clickEvent.ctrlKey || clickEvent.metaKey;
var postData = {
- 'tags[0]': "angularjs",
- 'tags[1]': "example",
+ 'tags[0]': 'angularjs',
+ 'tags[1]': 'example',
'private': true
};
@@ -183,8 +183,8 @@ angular.module('examples', [])
// The manifests provide the production index file but Plunkr wants
// a straight index.html
- if (filename === "index-production.html") {
- filename = "index.html";
+ if (filename === 'index-production.html') {
+ filename = 'index.html';
}
return {
diff --git a/docs/app/test/directivesSpec.js b/docs/app/test/directivesSpec.js
index 7966bb4be7f6..b9a24465f1b9 100644
--- a/docs/app/test/directivesSpec.js
+++ b/docs/app/test/directivesSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("code", function() {
+describe('code', function() {
var prettyPrintOne, oldPP;
var compile, scope;
diff --git a/docs/app/test/docsSpec.js b/docs/app/test/docsSpec.js
index 26f708976395..905a6d511181 100644
--- a/docs/app/test/docsSpec.js
+++ b/docs/app/test/docsSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("DocsController", function() {
+describe('DocsController', function() {
var $scope;
angular.module('fake', [])
@@ -17,7 +17,7 @@ describe("DocsController", function() {
describe('afterPartialLoaded', function() {
- it("should update the Google Analytics with currentPage path if currentPage exists", inject(function($window) {
+ it('should update the Google Analytics with currentPage path if currentPage exists', inject(function($window) {
$window._gaq = [];
$scope.currentPage = { path: 'a/b/c' };
$scope.$broadcast('$includeContentLoaded');
@@ -25,7 +25,7 @@ describe("DocsController", function() {
}));
- it("should update the Google Analytics with $location.path if currentPage is missing", inject(function($window, $location) {
+ it('should update the Google Analytics with $location.path if currentPage is missing', inject(function($window, $location) {
$window._gaq = [];
spyOn($location, 'path').and.returnValue('x/y/z');
$scope.$broadcast('$includeContentLoaded');
diff --git a/docs/config/index.js b/docs/config/index.js
index d0716012ad1c..4ec1423c65a0 100644
--- a/docs/config/index.js
+++ b/docs/config/index.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var path = require('canonical-path');
var packagePath = __dirname;
diff --git a/docs/config/processors/index-page.js b/docs/config/processors/index-page.js
index 5b07daa3982d..102e3f53db50 100644
--- a/docs/config/processors/index-page.js
+++ b/docs/config/processors/index-page.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var _ = require('lodash');
diff --git a/docs/config/processors/keywords.js b/docs/config/processors/keywords.js
index 2028d6e01f91..fb47e70add8a 100644
--- a/docs/config/processors/keywords.js
+++ b/docs/config/processors/keywords.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var _ = require('lodash');
var fs = require('fs');
diff --git a/docs/config/processors/versions-data.js b/docs/config/processors/versions-data.js
index b2dbf5cb55da..5e0fa94cb7e0 100644
--- a/docs/config/processors/versions-data.js
+++ b/docs/config/processors/versions-data.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var _ = require('lodash');
diff --git a/docs/config/services/deployments/debug.js b/docs/config/services/deployments/debug.js
index 991b9c79ce1d..991474c47ea0 100644
--- a/docs/config/services/deployments/debug.js
+++ b/docs/config/services/deployments/debug.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
module.exports = function debugDeployment(getVersion) {
return {
diff --git a/docs/config/services/deployments/default.js b/docs/config/services/deployments/default.js
index 51e8dde3f466..5a10e4dbddf0 100644
--- a/docs/config/services/deployments/default.js
+++ b/docs/config/services/deployments/default.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
module.exports = function defaultDeployment(getVersion) {
return {
diff --git a/docs/config/services/deployments/jquery.js b/docs/config/services/deployments/jquery.js
index ea7b640d4e70..b480b9f50056 100644
--- a/docs/config/services/deployments/jquery.js
+++ b/docs/config/services/deployments/jquery.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
module.exports = function jqueryDeployment(getVersion) {
return {
diff --git a/docs/config/services/deployments/production.js b/docs/config/services/deployments/production.js
index 5d680b82bd3e..f0de9890278c 100644
--- a/docs/config/services/deployments/production.js
+++ b/docs/config/services/deployments/production.js
@@ -1,7 +1,7 @@
-"use strict";
+'use strict';
var versionInfo = require('../../../../lib/versions/version-info');
-var cdnUrl = "//ajax.googleapis.com/ajax/libs/angularjs/" + versionInfo.cdnVersion;
+var cdnUrl = '//ajax.googleapis.com/ajax/libs/angularjs/' + versionInfo.cdnVersion;
module.exports = function productionDeployment(getVersion) {
return {
diff --git a/docs/config/services/errorNamespaceMap.js b/docs/config/services/errorNamespaceMap.js
index e1f3b9b37f28..237bcc905ebf 100644
--- a/docs/config/services/errorNamespaceMap.js
+++ b/docs/config/services/errorNamespaceMap.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var StringMap = require('stringmap');
/**
diff --git a/docs/config/services/getMinerrInfo.js b/docs/config/services/getMinerrInfo.js
index 9538bdc0bf5e..2847240dc0e8 100644
--- a/docs/config/services/getMinerrInfo.js
+++ b/docs/config/services/getMinerrInfo.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var path = require('canonical-path');
diff --git a/docs/config/services/getVersion.js b/docs/config/services/getVersion.js
index fa7a5d42e1b8..473a6fd9349b 100644
--- a/docs/config/services/getVersion.js
+++ b/docs/config/services/getVersion.js
@@ -1,4 +1,4 @@
-"use strict";
+'use strict';
var path = require('canonical-path');
/**
diff --git a/docs/content/guide/$location.ngdoc b/docs/content/guide/$location.ngdoc
index db121430cd24..921d400a2286 100644
--- a/docs/content/guide/$location.ngdoc
+++ b/docs/content/guide/$location.ngdoc
@@ -409,9 +409,9 @@ In these examples we use ` `. The inputs represen
.constant('baseHref', '/base/index.html')
.value('$sniffer', { history: true })
- .controller("LocationController", function($scope, $location) {
+ .controller('LocationController', function($scope, $location) {
$scope.$location = {};
- angular.forEach("protocol host port path search hash".split(" "), function(method) {
+ angular.forEach('protocol host port path search hash'.split(' '), function(method) {
$scope.$location[method] = function() {
var result = $location[method]();
return angular.isObject(result) ? angular.toJson(result) : result;
@@ -461,7 +461,7 @@ In these examples we use ` `. The inputs represen
return {
template: 'Address: ',
link: function(scope, element, attrs) {
- var input = element.children("input"), delay;
+ var input = element.children('input'), delay;
input.on('keypress keyup keydown', function(event) {
delay = (!delay ? $timeout(fireUrlChange, 250) : null);
@@ -563,9 +563,9 @@ In these examples we use ` `. The inputs represen
$locationProvider.html5Mode(true).hashPrefix('!');
})
- .controller("LocationController", function($scope, $location) {
+ .controller('LocationController', function($scope, $location) {
$scope.$location = {};
- angular.forEach("protocol host port path search hash".split(" "), function(method) {
+ angular.forEach('protocol host port path search hash'.split(' '), function(method) {
$scope.$location[method] = function() {
var result = $location[method]();
return angular.isObject(result) ? angular.toJson(result) : result;
@@ -615,7 +615,7 @@ In these examples we use ` `. The inputs represen
return {
template: 'Address: ',
link: function(scope, element, attrs) {
- var input = element.children("input"), delay;
+ var input = element.children('input'), delay;
input.on('keypress keyup keydown', function(event) {
delay = (!delay ? $timeout(fireUrlChange, 250) : null);
diff --git a/docs/content/guide/concepts.ngdoc b/docs/content/guide/concepts.ngdoc
index 3e8d941f9c27..69f1845ad883 100644
--- a/docs/content/guide/concepts.ngdoc
+++ b/docs/content/guide/concepts.ngdoc
@@ -121,7 +121,7 @@ different currencies and also pay the invoice.
return amount * this.usdToForeignRates[outCurr] / this.usdToForeignRates[inCurr];
};
this.pay = function pay() {
- window.alert("Thanks!");
+ window.alert('Thanks!');
};
});
@@ -221,7 +221,7 @@ Let's refactor our example and move the currency conversion into a service in an
return currencyConverter.convert(this.qty * this.cost, this.inCurr, outCurr);
};
this.pay = function pay() {
- window.alert("Thanks!");
+ window.alert('Thanks!');
};
}]);
@@ -313,7 +313,7 @@ The following example shows how this is done with Angular:
return currencyConverter.convert(this.qty * this.cost, this.inCurr, outCurr);
};
this.pay = function pay() {
- window.alert("Thanks!");
+ window.alert('Thanks!');
};
}]);
diff --git a/docs/content/guide/controller.ngdoc b/docs/content/guide/controller.ngdoc
index 947cae136abd..f4df3fb9fa64 100644
--- a/docs/content/guide/controller.ngdoc
+++ b/docs/content/guide/controller.ngdoc
@@ -186,7 +186,7 @@ previous example.
var myApp = angular.module('spicyApp2', []);
myApp.controller('SpicyController', ['$scope', function($scope) {
- $scope.customSpice = "wasabi";
+ $scope.customSpice = 'wasabi';
$scope.spice = 'very';
$scope.spicy = function(spice) {
diff --git a/docs/content/guide/filter.ngdoc b/docs/content/guide/filter.ngdoc
index 7e9b4ec33dc3..8f28388176fb 100644
--- a/docs/content/guide/filter.ngdoc
+++ b/docs/content/guide/filter.ngdoc
@@ -139,7 +139,7 @@ text upper-case.
.filter('reverse', function() {
return function(input, uppercase) {
input = input || '';
- var out = "";
+ var out = '';
for (var i = 0; i < input.length; i++) {
out = input.charAt(i) + out;
}
diff --git a/docs/content/guide/i18n.ngdoc b/docs/content/guide/i18n.ngdoc
index f419f4a0dbc8..680478d26436 100644
--- a/docs/content/guide/i18n.ngdoc
+++ b/docs/content/guide/i18n.ngdoc
@@ -226,11 +226,11 @@ You may find it helpful to play with the following example as you read the expla
angular.module('messageFormatExample', ['ngMessageFormat'])
.controller('ckCtrl', function($scope, $injector, $parse) {
- var people = [new Person("Alice", "female"),
- new Person("Bob", "male"),
- new Person("Charlie", "male")];
+ var people = [new Person('Alice', 'female'),
+ new Person('Bob', 'male'),
+ new Person('Charlie', 'male')];
- $scope.sender = new Person("Harry Potter", "male");
+ $scope.sender = new Person('Harry Potter', 'male');
$scope.recipients = people.slice();
$scope.setNumRecipients = function(n) {
diff --git a/docs/content/guide/services.ngdoc b/docs/content/guide/services.ngdoc
index 4fb2fd93f7a9..5c02774cf9a5 100644
--- a/docs/content/guide/services.ngdoc
+++ b/docs/content/guide/services.ngdoc
@@ -53,7 +53,7 @@ subsystem takes care of the rest.
return function(msg) {
msgs.push(msg);
if (msgs.length === 3) {
- win.alert(msgs.join("\n"));
+ win.alert(msgs.join('\n'));
msgs = [];
}
};
diff --git a/docs/gulpfile.js b/docs/gulpfile.js
index 93e0ca312761..386b5dd798bb 100644
--- a/docs/gulpfile.js
+++ b/docs/gulpfile.js
@@ -39,8 +39,16 @@ var getMergedEslintConfig = function(filepath) {
// While alerts would be bad to have in the library or test code,
// they're perfectly fine in examples.
'no-alert': 'off',
+
+ // The following rules have to be disabled or tweaked because dgeni template wrappers
+ // don't follow them and we have no way to validate only the parts taken
+ // from ngdoc.
+
// some dgeni-packages templates generate whitespace-only lines
- 'no-trailing-spaces': ['error', { 'skipBlankLines': true }]
+ 'no-trailing-spaces': ['error', { 'skipBlankLines': true }],
+
+ // dgeni templates use double quotes as string delimiters
+ quotes: 'off'
},
ignore: false,
useEslintrc: false
diff --git a/gdocs.js b/gdocs.js
index dab9b083221d..e83e0eca26fd 100755
--- a/gdocs.js
+++ b/gdocs.js
@@ -89,7 +89,7 @@ function download(collection, name, url) {
// fix smart-quotes
data = data.replace(/[“”]/g, '"');
- data = data.replace(/[‘’]/g, "'");
+ data = data.replace(/[‘’]/g, '\'');
data = data + '\n';
@@ -135,7 +135,7 @@ function login(username, password) {
});
if (token) {
fs.writeFileSync('tmp/gdocs.auth', token);
- console.log("logged in, token saved in 'tmp/gdocs.auth'");
+ console.log('logged in, token saved in \'tmp/gdocs.auth\'');
} else {
console.log('failed to log in');
}
@@ -209,23 +209,23 @@ function encodeData(obj) {
function askPassword(callback) {
var stdin = process.openStdin(),
- stdio = process.binding("stdio");
+ stdio = process.binding('stdio');
stdio.setRawMode();
console.log('Enter your password:');
- var password = "";
- stdin.on("data", function(c) {
- c = c + "";
+ var password = '';
+ stdin.on('data', function(c) {
+ c = c + '';
switch (c) {
- case "\n":
- case "\r":
- case "\u0004":
+ case '\n':
+ case '\r':
+ case '\u0004':
stdio.setRawMode(false);
stdin.pause();
callback(password);
break;
- case "\u0003":
+ case '\u0003':
process.exit();
break;
default:
diff --git a/i18n/e2e/i18n-e2e.js b/i18n/e2e/i18n-e2e.js
index dd01295db5c4..b34022d5174a 100644
--- a/i18n/e2e/i18n-e2e.js
+++ b/i18n/e2e/i18n-e2e.js
@@ -1,53 +1,53 @@
'use strict';
-describe("localized filters", function() {
- describe("es locale", function() {
+describe('localized filters', function() {
+ describe('es locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_es.html");
+ browser().navigateTo('localeTest_es.html');
});
it('should check filters for es locale', function() {
expect(binding('input | date:"medium"')).toBe('03/06/1977 18:07:23');
- expect(binding('input | date:"longDate"')).toBe("3 de junio de 1977");
+ expect(binding('input | date:"longDate"')).toBe('3 de junio de 1977');
expect(binding('input | number')).toBe('234.234.443.432');
expect(binding('input | currency')).toBe('€\u00a0234.234.443.432,00');
});
});
- describe("cs locale", function() {
+ describe('cs locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_cs.html");
+ browser().navigateTo('localeTest_cs.html');
});
it('should check filters for cs locale', function() {
expect(binding('input | date:"medium"')).toBe('3.6.1977 18:07:23');
- expect(binding('input | date:"longDate"')).toBe("3. června 1977");
+ expect(binding('input | date:"longDate"')).toBe('3. června 1977');
expect(binding('input | number')).toBe('234\u00a0234\u00a0443\u00a0432');
expect(binding('input | currency')).toBe('234\u00a0234\u00a0443\u00a0432,00\u00a0K\u010d');
});
});
- describe("de locale", function() {
+ describe('de locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_de.html");
+ browser().navigateTo('localeTest_de.html');
});
it('should check filters for de locale', function() {
expect(binding('input | date:"medium"')).toBe('03.06.1977 18:07:23');
- expect(binding('input | date:"longDate"')).toBe("3. Juni 1977");
+ expect(binding('input | date:"longDate"')).toBe('3. Juni 1977');
expect(binding('input | number')).toBe('234.234.443.432');
expect(binding('input | currency')).toBe('234.234.443.432,00\u00a0€');
});
});
- describe("en locale", function() {
+ describe('en locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_en.html");
+ browser().navigateTo('localeTest_en.html');
});
it('should check filters for en locale', function() {
expect(binding('input | date:"medium"')).toBe('Jun 3, 1977 6:07:23 PM');
- expect(binding('input | date:"longDate"')).toBe("June 3, 1977");
+ expect(binding('input | date:"longDate"')).toBe('June 3, 1977');
expect(binding('input | number')).toBe('234,234,443,432');
expect(binding('input | currency')).toBe('$234,234,443,432.00');
});
@@ -95,14 +95,14 @@ describe("localized filters", function() {
});
});
- describe("sk locale", function() {
+ describe('sk locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_sk.html");
+ browser().navigateTo('localeTest_sk.html');
});
it('should check filters for sk locale', function() {
expect(binding('input | date:"medium"')).toBe('3.6.1977 18:07:23');
- expect(binding('input | date:"longDate"')).toBe("3. júna 1977");
+ expect(binding('input | date:"longDate"')).toBe('3. júna 1977');
expect(binding('input | number')).toBe('234\u00a0234\u00a0443\u00a0432');
expect(binding('input | currency')).toBe('234\u00a0234\u00a0443\u00a0432,00\u00a0Sk');
});
@@ -134,14 +134,14 @@ describe("localized filters", function() {
});
});
- describe("zh locale", function() {
+ describe('zh locale', function() {
beforeEach(function() {
- browser().navigateTo("localeTest_zh.html");
+ browser().navigateTo('localeTest_zh.html');
});
it('should check filters for zh locale', function() {
expect(binding('input | date:"medium"')).toBe('1977-6-3 下午6:07:23');
- expect(binding('input | date:"longDate"')).toBe("1977年6月3日");
+ expect(binding('input | date:"longDate"')).toBe('1977年6月3日');
expect(binding('input | number')).toBe('234,234,443,432');
expect(binding('input | currency')).toBe('¥234,234,443,432.00');
});
diff --git a/i18n/spec/closureI18nExtractorSpec.js b/i18n/spec/closureI18nExtractorSpec.js
index 822aea4065b3..41ef480bbebf 100644
--- a/i18n/spec/closureI18nExtractorSpec.js
+++ b/i18n/spec/closureI18nExtractorSpec.js
@@ -31,32 +31,32 @@ function newTestLocaleInfo() {
shortTime: 'HH:mm'
},
NUMBER_FORMATS: {
- "DECIMAL_SEP": ".",
- "GROUP_SEP": ",",
- "PATTERNS": [{
- "minInt": 1,
- "minFrac": 0,
- "macFrac": 0,
- "posPre": "",
- "posSuf": "",
- "negPre": "-",
- "negSuf": "",
- "gSize": 3,
- "lgSize": 3,
- "maxFrac": 3
+ 'DECIMAL_SEP': '.',
+ 'GROUP_SEP': ',',
+ 'PATTERNS': [{
+ 'minInt': 1,
+ 'minFrac': 0,
+ 'macFrac': 0,
+ 'posPre': '',
+ 'posSuf': '',
+ 'negPre': '-',
+ 'negSuf': '',
+ 'gSize': 3,
+ 'lgSize': 3,
+ 'maxFrac': 3
}, {
- "minInt": 1,
- "minFrac": 2,
- "macFrac": 0,
- "posPre": "¤",
- "posSuf": "",
- "negPre": "¤-",
- "negSuf": "",
- "gSize": 3,
- "lgSize": 3,
- "maxFrac": 2
+ 'minInt': 1,
+ 'minFrac': 2,
+ 'macFrac': 0,
+ 'posPre': '¤',
+ 'posSuf': '',
+ 'negPre': '¤-',
+ 'negSuf': '',
+ 'gSize': 3,
+ 'lgSize': 3,
+ 'maxFrac': 2
}],
- "CURRENCY_SYM": "£"
+ 'CURRENCY_SYM': '£'
}}};
}
@@ -87,26 +87,26 @@ describe('findLocaleId', function() {
});
});
-describe("extractNumberSymbols", function() {
- it("should extract number data", function() {
+describe('extractNumberSymbols', function() {
+ it('should extract number data', function() {
var CONTENT = [
- "goog.provide('goog.i18n.NumberFormatSymbols_en_GB');",
- "goog.i18n.NumberFormatSymbols_en_GB = {",
- "DECIMAL_SEP: '.',",
- "GROUP_SEP: ',',",
- "PERCENT: '%',",
- "ZERO_DIGIT: '0',",
- "PLUS_SIGN: '+',",
- "MINUS_SIGN: '-',",
- "EXP_SYMBOL: 'E',",
- "PERMILL: '\u2030',",
- "INFINITY: '\u221E',",
- "NAN: 'NaN',",
- "DECIMAL_PATTERN: '#,##0.###',",
- "SCIENTIFIC_PATTERN: '#E0',",
- "PERCENT_PATTERN: '#,##0%',",
- "CURRENCY_PATTERN: '\u00A4#,##0.00',",
- "DEF_CURRENCY_CODE: 'GBP' };"
+ 'goog.provide(\'goog.i18n.NumberFormatSymbols_en_GB\');',
+ 'goog.i18n.NumberFormatSymbols_en_GB = {',
+ 'DECIMAL_SEP: \'.\',',
+ 'GROUP_SEP: \',\',',
+ 'PERCENT: \'%\',',
+ 'ZERO_DIGIT: \'0\',',
+ 'PLUS_SIGN: \'+\',',
+ 'MINUS_SIGN: \'-\',',
+ 'EXP_SYMBOL: \'E\',',
+ 'PERMILL: \'\u2030\',',
+ 'INFINITY: \'\u221E\',',
+ 'NAN: \'NaN\',',
+ 'DECIMAL_PATTERN: \'#,##0.###\',',
+ 'SCIENTIFIC_PATTERN: \'#E0\',',
+ 'PERCENT_PATTERN: \'#,##0%\',',
+ 'CURRENCY_PATTERN: \'\u00A4#,##0.00\',',
+ 'DEF_CURRENCY_CODE: \'GBP\' };'
].join('\n');
var currencySymbols = {'GBP':[2, '£', 'GB£']};
@@ -130,15 +130,15 @@ describe("extractNumberSymbols", function() {
});
});
-describe("extractCurrencySymbols", function() {
- it("should extract currency data", function() {
+describe('extractCurrencySymbols', function() {
+ it('should extract currency data', function() {
var CONTENT = [
- "goog.i18n.currency.CurrencyInfo = {",
- " 'GBP':[2, '£', 'GB£'],",
- "};",
- "goog.i18n.currency.CurrencyInfoTier2 = {",
- " 'AOA':[2, 'Kz', 'Kz'],",
- "};"
+ 'goog.i18n.currency.CurrencyInfo = {',
+ ' \'GBP\':[2, \'£\', \'GB£\'],',
+ '};',
+ 'goog.i18n.currency.CurrencyInfoTier2 = {',
+ ' \'AOA\':[2, \'Kz\', \'Kz\'],',
+ '};'
].join('\n');
var currencySymbols = extractCurrencySymbols(CONTENT);
@@ -152,42 +152,42 @@ describe("extractCurrencySymbols", function() {
});
-describe("extractDateTimeSymbols", function() {
- it("should extract date time data", function() {
+describe('extractDateTimeSymbols', function() {
+ it('should extract date time data', function() {
var CONTENT = [
- "goog.i18n.DateTimeSymbols_fr_CA = {",
- " ERAS: ['av. J.-C.', 'ap. J.-C.'],",
- " ERANAMES: ['avant Jésus-Christ', 'après Jésus-Christ'],",
- " NARROWMONTHS: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],",
- " STANDALONENARROWMONTHS: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O',",
- " 'N', 'D'],",
- " MONTHS: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',",
- " 'août', 'septembre', 'octobre', 'novembre', 'décembre'],",
- " STANDALONEMONTHS: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',",
- " 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],",
- " SHORTMONTHS: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.',",
- " 'août', 'sept.', 'oct.', 'nov.', 'déc.'],",
- " STANDALONESHORTMONTHS: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin',",
- " 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],",
- " WEEKDAYS: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi',",
- " 'samedi'],",
- " STANDALONEWEEKDAYS: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi',",
- " 'vendredi', 'samedi'],",
- " SHORTWEEKDAYS: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],",
- " STANDALONESHORTWEEKDAYS: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.',",
- " 'sam.'],",
- " NARROWWEEKDAYS: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],",
- " STANDALONENARROWWEEKDAYS: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],",
- " SHORTQUARTERS: ['T1', 'T2', 'T3', 'T4'],",
- " QUARTERS: ['1er trimestre', '2e trimestre', '3e trimestre', '4e trimestre'],",
- " AMPMS: ['AM', 'PM'],",
- " DATEFORMATS: ['EEEE d MMMM y', 'd MMMM y', 'yyyy-MM-dd', 'yy-MM-dd'],",
- " TIMEFORMATS: ['HH \\'h\\' mm \\'min\\' ss \\'s\\' zzzz', 'HH:mm:ss z',",
- " 'HH:mm:ss', 'HH:mm'],",
- " FIRSTDAYOFWEEK: 6,",
- " WEEKENDRANGE: [5, 6],",
- " FIRSTWEEKCUTOFFDAY: 2",
- "};"
+ 'goog.i18n.DateTimeSymbols_fr_CA = {',
+ ' ERAS: [\'av. J.-C.\', \'ap. J.-C.\'],',
+ ' ERANAMES: [\'avant Jésus-Christ\', \'après Jésus-Christ\'],',
+ ' NARROWMONTHS: [\'J\', \'F\', \'M\', \'A\', \'M\', \'J\', \'J\', \'A\', \'S\', \'O\', \'N\', \'D\'],',
+ ' STANDALONENARROWMONTHS: [\'J\', \'F\', \'M\', \'A\', \'M\', \'J\', \'J\', \'A\', \'S\', \'O\',',
+ ' \'N\', \'D\'],',
+ ' MONTHS: [\'janvier\', \'février\', \'mars\', \'avril\', \'mai\', \'juin\', \'juillet\',',
+ ' \'août\', \'septembre\', \'octobre\', \'novembre\', \'décembre\'],',
+ ' STANDALONEMONTHS: [\'janvier\', \'février\', \'mars\', \'avril\', \'mai\', \'juin\',',
+ ' \'juillet\', \'août\', \'septembre\', \'octobre\', \'novembre\', \'décembre\'],',
+ ' SHORTMONTHS: [\'janv.\', \'févr.\', \'mars\', \'avr.\', \'mai\', \'juin\', \'juil.\',',
+ ' \'août\', \'sept.\', \'oct.\', \'nov.\', \'déc.\'],',
+ ' STANDALONESHORTMONTHS: [\'janv.\', \'févr.\', \'mars\', \'avr.\', \'mai\', \'juin\',',
+ ' \'juil.\', \'août\', \'sept.\', \'oct.\', \'nov.\', \'déc.\'],',
+ ' WEEKDAYS: [\'dimanche\', \'lundi\', \'mardi\', \'mercredi\', \'jeudi\', \'vendredi\',',
+ ' \'samedi\'],',
+ ' STANDALONEWEEKDAYS: [\'dimanche\', \'lundi\', \'mardi\', \'mercredi\', \'jeudi\',',
+ ' \'vendredi\', \'samedi\'],',
+ ' SHORTWEEKDAYS: [\'dim.\', \'lun.\', \'mar.\', \'mer.\', \'jeu.\', \'ven.\', \'sam.\'],',
+ ' STANDALONESHORTWEEKDAYS: [\'dim.\', \'lun.\', \'mar.\', \'mer.\', \'jeu.\', \'ven.\',',
+ ' \'sam.\'],',
+ ' NARROWWEEKDAYS: [\'D\', \'L\', \'M\', \'M\', \'J\', \'V\', \'S\'],',
+ ' STANDALONENARROWWEEKDAYS: [\'D\', \'L\', \'M\', \'M\', \'J\', \'V\', \'S\'],',
+ ' SHORTQUARTERS: [\'T1\', \'T2\', \'T3\', \'T4\'],',
+ ' QUARTERS: [\'1er trimestre\', \'2e trimestre\', \'3e trimestre\', \'4e trimestre\'],',
+ ' AMPMS: [\'AM\', \'PM\'],',
+ ' DATEFORMATS: [\'EEEE d MMMM y\', \'d MMMM y\', \'yyyy-MM-dd\', \'yy-MM-dd\'],',
+ ' TIMEFORMATS: [\'HH \\\'h\\\' mm \\\'min\\\' ss \\\'s\\\' zzzz\', \'HH:mm:ss z\',',
+ ' \'HH:mm:ss\', \'HH:mm\'],',
+ ' FIRSTDAYOFWEEK: 6,',
+ ' WEEKENDRANGE: [5, 6],',
+ ' FIRSTWEEKCUTOFFDAY: 2',
+ '};'
].join('\n');
var localeInfo = {};
var expectedLocaleInfo = {
@@ -222,34 +222,34 @@ describe("extractDateTimeSymbols", function() {
});
});
-describe("pluralExtractor", function() {
- it("should output PLURAL_CAT in the output string code", function() {
+describe('pluralExtractor', function() {
+ it('should output PLURAL_CAT in the output string code', function() {
var content = (
- "goog.provide('goog.i18n.pluralRules');\n" +
- "\n" +
- "goog.i18n.pluralRules.Keyword = {\n" +
- " ZERO: 'zero',\n" +
- " ONE: 'one',\n" +
- " TWO: 'two',\n" +
- " FEW: 'few',\n" +
- " MANY: 'many',\n" +
- " OTHER: 'other'\n" +
- "};\n" +
- "\n" +
- "goog.i18n.pluralRules.frSelect_ = function(n) {\n" +
- " if (n >= 0 && n < 2) {\n" +
- " return goog.i18n.pluralRules.Keyword.ONE;\n" +
- " }\n" +
- " return goog.i18n.pluralRules.Keyword.OTHER;\n" +
- "};\n" +
- "\n" +
- "if (goog.LOCALE == 'fr') {\n" +
- " goog.i18n.pluralRules.select = goog.i18n.pluralRules.frSelect_;\n" +
- "}"
+ 'goog.provide(\'goog.i18n.pluralRules\');\n' +
+ '\n' +
+ 'goog.i18n.pluralRules.Keyword = {\n' +
+ ' ZERO: \'zero\',\n' +
+ ' ONE: \'one\',\n' +
+ ' TWO: \'two\',\n' +
+ ' FEW: \'few\',\n' +
+ ' MANY: \'many\',\n' +
+ ' OTHER: \'other\'\n' +
+ '};\n' +
+ '\n' +
+ 'goog.i18n.pluralRules.frSelect_ = function(n) {\n' +
+ ' if (n >= 0 && n < 2) {\n' +
+ ' return goog.i18n.pluralRules.Keyword.ONE;\n' +
+ ' }\n' +
+ ' return goog.i18n.pluralRules.Keyword.OTHER;\n' +
+ '};\n' +
+ '\n' +
+ 'if (goog.LOCALE == \'fr\') {\n' +
+ ' goog.i18n.pluralRules.select = goog.i18n.pluralRules.frSelect_;\n' +
+ '}'
);
var localeInfo = newTestLocaleInfo();
closureI18nExtractor.pluralExtractor(content, localeInfo);
- var pluralCat = localeInfo["fr_CA"].pluralCat;
+ var pluralCat = localeInfo['fr_CA'].pluralCat;
expect(pluralCat).toBeDefined();
// pluralCat is the source text for the pluralCat and contains @@
// placeholders that need to be stripped before evaluation.
@@ -258,38 +258,38 @@ describe("pluralExtractor", function() {
// pluralCat requires these constants to exist.
// eslint-disable-next-line no-unused-vars
var PLURAL_CATEGORY = {
- ZERO: "zero", ONE: "one", TWO: "two",
- FEW: "few", MANY: "many", OTHER: "other"
+ ZERO: 'zero', ONE: 'one', TWO: 'two',
+ FEW: 'few', MANY: 'many', OTHER: 'other'
};
// Obtain the function by evaluating the source text.
// eslint-disable-next-line no-eval
- pluralCat = eval("(" + pluralCat + ")");
+ pluralCat = eval('(' + pluralCat + ')');
// Confirm some expectations for pluralCat in fr_CA.
- expect(pluralCat(0)).toEqual("one");
- expect(pluralCat(3)).toEqual("other");
+ expect(pluralCat(0)).toEqual('one');
+ expect(pluralCat(3)).toEqual('other');
});
});
-describe("serializeContent", function() {
- it("should not make any modifications to the content of the locale", function() {
+describe('serializeContent', function() {
+ it('should not make any modifications to the content of the locale', function() {
var serializedContent = closureI18nExtractor.serializeContent(newTestLocaleInfo());
// eslint-disable-next-line no-eval
- expect(eval("(" + serializedContent + ")")).toEqual(newTestLocaleInfo());
+ expect(eval('(' + serializedContent + ')')).toEqual(newTestLocaleInfo());
});
- it("should only have ascii characters", function() {
+ it('should only have ascii characters', function() {
var serializedContent = closureI18nExtractor.serializeContent(newTestLocaleInfo());
expect((/[^\u0001-\u007f]/).test(serializedContent)).toBe(false);
});
- it("should not transform arrays into objects", function() {
+ it('should not transform arrays into objects', function() {
var serializedContent = closureI18nExtractor.serializeContent(newTestLocaleInfo().fr_CA);
// eslint-disable-next-line no-eval
- var deserializedLocale = eval("(" + serializedContent + ")");
+ var deserializedLocale = eval('(' + serializedContent + ')');
expect(deserializedLocale.DATETIME_FORMATS.MONTH.length).not.toBeUndefined();
});
});
-describe("outputLocale", function() {
- it("should render the correct locale ids", function() {
+describe('outputLocale', function() {
+ it('should render the correct locale ids', function() {
var output = outputLocale(newTestLocaleInfo(), 'fr_CA');
expect(output).toContain('"id": "fr-ca"');
expect(output).toContain('"localeID": "fr_CA"');
diff --git a/i18n/spec/converterSpec.js b/i18n/spec/converterSpec.js
index decaf04033d4..ee6bf80698ed 100644
--- a/i18n/spec/converterSpec.js
+++ b/i18n/spec/converterSpec.js
@@ -2,7 +2,7 @@
var converter = require('../src/converter.js');
-describe("convertNumberData", function() {
+describe('convertNumberData', function() {
var convert = converter.convertNumberData,
dataObj = { DECIMAL_SEP: ',',
GROUP_SEP: '.',
@@ -26,7 +26,7 @@ describe("convertNumberData", function() {
});
-describe("convertDatetimeData", function() {
+describe('convertDatetimeData', function() {
var convert = converter.convertDatetimeData,
dataObj = { MONTHS: ['Enero', 'Pebrero'],
STANDALONEMONTHS: ['Enero', 'Pebrero'],
diff --git a/i18n/spec/parserSpec.js b/i18n/spec/parserSpec.js
index 968185af1e20..f383122a057a 100644
--- a/i18n/spec/parserSpec.js
+++ b/i18n/spec/parserSpec.js
@@ -24,7 +24,7 @@ describe('parsePattern', function() {
parseAndExpect('#,##0.###', '', '-', '', '', 1, 0, 3, 3, 3);
parseAndExpect('#,##0.###;#,##0.###-', '', '', '', '-', 1, 0, 3, 3, 3);
parseAndExpect('#,##,##0.###', '', '-', '', '', 1, 0, 3, 2, 3);
- parseAndExpect("#,##0.###;'\u202A'-#,##0.###'\u202C'",
+ parseAndExpect('#,##0.###;\'\u202A\'-#,##0.###\'\u202C\'',
'', '\u202A-', '', '\u202C', 1, 0, 3, 3, 3);
parseAndExpect('#0.###;#0.###-', '', '', '', '-', 1, 0, 3, 0, 0);
@@ -33,7 +33,7 @@ describe('parsePattern', function() {
it('should parse CURRENCY patterns', function() {
// all CURRENCY patterns from closure
parseAndExpect('#,##0.00 \u00A4', '', '-', ' \u00A4', ' \u00A4', 1, 2, 2, 3, 3);
- parseAndExpect("#,##0.00\u00A0\u00A4;'\u202A'-#,##0.00'\u202C'\u00A0\u00A4",
+ parseAndExpect('#,##0.00\u00A0\u00A4;\'\u202A\'-#,##0.00\'\u202C\'\u00A0\u00A4',
'', '\u202A-', '\u00A0\u00A4', '\u202C\u00A0\u00A4', 1, 2, 2, 3, 3);
parseAndExpect('#,##0.00 \u00A4;(#,##0.00 \u00A4)',
'', '(', ' \u00A4', ' \u00A4)', 1, 2, 2, 3, 3);
diff --git a/i18n/src/closureI18nExtractor.js b/i18n/src/closureI18nExtractor.js
index 45b32a229b53..81d367a7158b 100644
--- a/i18n/src/closureI18nExtractor.js
+++ b/i18n/src/closureI18nExtractor.js
@@ -84,7 +84,7 @@ function pluralExtractor(content, localeInfo) {
// eslint-disable-next-line no-eval
eval(contentText);
} catch (e) {
- console.log("Error in eval(contentText): " + e.stack);
+ console.log('Error in eval(contentText): ' + e.stack);
}
if (!goog.i18n.pluralRules.select) {
console.log('No select for lang [' + goog.LOCALE + ']');
@@ -99,7 +99,7 @@ function pluralExtractor(content, localeInfo) {
replace(/\n/g, '');
///@@ is a crazy place holder to be replaced before writing to file
- localeInfo[localeIds[i]].pluralCat = "@@" + temp + "@@";
+ localeInfo[localeIds[i]].pluralCat = '@@' + temp + '@@';
}
}
@@ -125,7 +125,7 @@ function canonicalizeForJsonStringify(unused_key, object) {
// 2. https://code.google.com/p/v8/issues/detail?id=164
// ECMA-262 does not specify enumeration order. The de facto standard
// is to match insertion order, which V8 also does ...
- if (typeof object !== "object" || Object.prototype.toString.apply(object) === '[object Array]') {
+ if (typeof object !== 'object' || Object.prototype.toString.apply(object) === '[object Array]') {
return object;
}
var result = {};
@@ -158,7 +158,7 @@ function outputLocale(localeInfo, localeID) {
// don't want to write locale files that only have dateformat (i.e. missing
// number formats.) So we skip them.
if (!localeObj.NUMBER_FORMATS) {
- console.log("Skipping locale %j: Don't have any number formats", localeID);
+ console.log('Skipping locale %j: Don\'t have any number formats', localeID);
return null;
}
@@ -222,7 +222,7 @@ function outputLocale(localeInfo, localeID) {
}
var prefix =
- "'use strict';\n" +
+ '\'use strict\';\n' +
'angular.module("ngLocale", [], ["$provide", function($provide) {\n' +
'var PLURAL_CATEGORY = {' +
'ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"' +
diff --git a/i18n/src/closureSlurper.js b/i18n/src/closureSlurper.js
index 4cc23358ab3a..c5226bf323b6 100755
--- a/i18n/src/closureSlurper.js
+++ b/i18n/src/closureSlurper.js
@@ -11,7 +11,7 @@ var NG_LOCALE_DIR = '../src/ngLocale/';
function readSymbols() {
- console.log("Processing currency and number symbols ...");
+ console.log('Processing currency and number symbols ...');
var numericStagePromise = qfs.read(__dirname + '/../closure/currencySymbols.js', 'b')
.then(function(content) {
var currencySymbols = closureI18nExtractor.extractCurrencySymbols(content);
@@ -25,7 +25,7 @@ function readSymbols() {
});
});
- console.log("Processing datetime symbols ...");
+ console.log('Processing datetime symbols ...');
var datetimeStagePromise = qfs.read(__dirname + '/../closure/datetimeSymbols.js', 'b')
.then(function(content) {
closureI18nExtractor.extractDateTimeSymbols(content, localeInfo);
@@ -98,4 +98,4 @@ createFolder(NG_LOCALE_DIR)
.then(readSymbols)
.then(extractPlurals)
.then(writeLocaleFiles)
- .done(function(num_files) { console.log("Wrote %j files.\nAll Done!", num_files); });
+ .done(function(num_files) { console.log('Wrote %j files.\nAll Done!', num_files); });
diff --git a/karma-shared.conf.js b/karma-shared.conf.js
index 5a60585001cb..ee4c78d00d7b 100644
--- a/karma-shared.conf.js
+++ b/karma-shared.conf.js
@@ -75,10 +75,10 @@ module.exports = function(config, specificOptions) {
version: '11'
},
'SL_iOS': {
- base: "SauceLabs",
- browserName: "iphone",
- platform: "OS X 10.10",
- version: "8.1"
+ base: 'SauceLabs',
+ browserName: 'iphone',
+ platform: 'OS X 10.10',
+ version: '8.1'
},
'BS_Chrome': {
diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js
index dc925339f271..60980d7e508f 100644
--- a/lib/grunt/utils.js
+++ b/lib/grunt/utils.js
@@ -25,7 +25,7 @@ module.exports = {
p.stdout.pipe(process.stdout);
p.stderr.pipe(process.stderr);
p.on('exit', function(code) {
- if (code !== 0) grunt.fail.warn("Karma test(s) failed. Exit code: " + code);
+ if (code !== 0) grunt.fail.warn('Karma test(s) failed. Exit code: ' + code);
done();
});
},
@@ -110,9 +110,9 @@ module.exports = {
//escape for js
css = css
.replace(/\\/g, '\\\\')
- .replace(/'/g, "\\'")
+ .replace(/'/g, '\\\'')
.replace(/\r?\n/g, '\\n');
- js = "!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('');";
+ js = '!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend(\'\');';
state.js.push(js);
return state;
@@ -164,7 +164,7 @@ module.exports = {
singleStrict: function(src, insert) {
return src
.replace(/\s*("|')use strict("|');\s*/g, insert) // remove all file-specific strict mode flags
- .replace(/(\(function\([^)]*\)\s*\{)/, "$1'use strict';"); // add single strict mode flag
+ .replace(/(\(function\([^)]*\)\s*\{)/, '$1\'use strict\';'); // add single strict mode flag
},
@@ -175,7 +175,7 @@ module.exports = {
min: function(file, done) {
- var classPathSep = (process.platform === "win32") ? ';' : ':';
+ var classPathSep = (process.platform === 'win32') ? ';' : ':';
var minFile = file.replace(/\.js$/, '.min.js');
var mapFile = minFile + '.map';
var mapFileName = mapFile.match(/[^\/]+$/)[0];
@@ -220,7 +220,7 @@ module.exports = {
//returns the 32-bit mode force flags for java compiler if supported, this makes the build much faster
java32flags: function() {
- if (process.platform === "win32") return '';
+ if (process.platform === 'win32') return '';
if (shell.exec('java -version -d32 2>&1', {silent: true}).code !== 0) return '';
return ' -d32 -client';
},
@@ -270,9 +270,9 @@ module.exports = {
var CSP = /\.csp\W/;
if (CSP.test(req.url)) {
- res.setHeader("X-WebKit-CSP", "default-src 'self';");
- res.setHeader("X-Content-Security-Policy", "default-src 'self'");
- res.setHeader("Content-Security-Policy", "default-src 'self'");
+ res.setHeader('X-WebKit-CSP', 'default-src \'self\';');
+ res.setHeader('X-Content-Security-Policy', 'default-src \'self\'');
+ res.setHeader('Content-Security-Policy', 'default-src \'self\'');
}
next();
};
diff --git a/lib/grunt/validate-angular-files.js b/lib/grunt/validate-angular-files.js
index 94829f9e729a..d305076bcfe4 100644
--- a/lib/grunt/validate-angular-files.js
+++ b/lib/grunt/validate-angular-files.js
@@ -2,7 +2,7 @@
var path = require('path');
var fs = require('fs');
-var glob = require("glob");
+var glob = require('glob');
var _ = require('lodash');
var files = require('../../angularFiles').files;
diff --git a/lib/versions/version-info.js b/lib/versions/version-info.js
index 7baef6500b04..39a5f8a1d9ff 100644
--- a/lib/versions/version-info.js
+++ b/lib/versions/version-info.js
@@ -57,8 +57,8 @@ var getCodeName = function(tagName) {
var tagMessage = gitCatOutput.match(/^.*codename.*$/mg)[0];
var codeName = tagMessage && tagMessage.match(/codename\((.*)\)/)[1];
if (!codeName) {
- throw new Error("Could not extract release code name. The message of tag " + tagName +
- " must match '*codename(some release name)*'");
+ throw new Error('Could not extract release code name. The message of tag ' + tagName +
+ ' must match \'*codename(some release name)*\'');
}
return codeName;
};
diff --git a/scripts/npm/clean-shrinkwrap.js b/scripts/npm/clean-shrinkwrap.js
index a5a5421c0863..0e05f7c73790 100755
--- a/scripts/npm/clean-shrinkwrap.js
+++ b/scripts/npm/clean-shrinkwrap.js
@@ -37,4 +37,4 @@ cleanModule(shrinkwrap, shrinkwrap.name);
var cleanShrinkwrapPath = path.join(__dirname, '..', '..', 'npm-shrinkwrap.clean.json');
console.log('Writing cleaned to', cleanShrinkwrapPath);
-fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + "\n");
+fs.writeFileSync(cleanShrinkwrapPath, JSON.stringify(sorted(shrinkwrap), null, 2) + '\n');
diff --git a/src/Angular.js b/src/Angular.js
index 252582517e65..60463f1e1eb3 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -194,7 +194,7 @@ function isArrayLike(obj) {
// Support: iOS 8.2 (not reproducible in simulator)
// "length" in obj used to prevent JIT error (gh-11508)
- var length = "length" in Object(obj) && obj.length;
+ var length = 'length' in Object(obj) && obj.length;
// NodeList objects (with `item` method) and
// other objects with suitable length characteristics are array-like
@@ -814,10 +814,10 @@ function copy(source, destination) {
if (destination) {
if (isTypedArray(destination) || isArrayBuffer(destination)) {
- throw ngMinErr('cpta', "Can't copy! TypedArray destination cannot be mutated.");
+ throw ngMinErr('cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
if (source === destination) {
- throw ngMinErr('cpi', "Can't copy! Source and destination are identical.");
+ throw ngMinErr('cpi', 'Can\'t copy! Source and destination are identical.');
}
// Empty the destination object
@@ -883,7 +883,7 @@ function copy(source, destination) {
if (isWindow(source) || isScope(source)) {
throw ngMinErr('cpws',
- "Can't copy! Making copies of Window or Scope instances is not supported.");
+ 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
}
var needsRecurse = false;
@@ -1343,7 +1343,7 @@ function tryDecodeURIComponent(value) {
*/
function parseKeyValue(/**string*/keyValue) {
var obj = {};
- forEach((keyValue || "").split('&'), function(keyValue) {
+ forEach((keyValue || '').split('&'), function(keyValue) {
var splitPoint, key, val;
if (keyValue) {
key = keyValue = keyValue.replace(/\+/g,'%20');
@@ -1546,7 +1546,7 @@ function getNgAttribute(element, ngAttr) {
}])
.controller('GoodController2', GoodController2);
function GoodController2($scope) {
- $scope.name = "World";
+ $scope.name = 'World';
}
GoodController2.$inject = ['$scope'];
@@ -1596,7 +1596,7 @@ function angularInit(element, bootstrap) {
}
});
if (appElement) {
- config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
+ config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
bootstrap(appElement, module ? [module] : [], config);
}
}
@@ -1674,7 +1674,7 @@ function bootstrap(element, modules, config) {
// Encode angle brackets to prevent input from being sanitized to empty string #8683.
throw ngMinErr(
'btstrpd',
- "App already bootstrapped with this element '{0}'",
+ 'App already bootstrapped with this element \'{0}\'',
tag.replace(/,'<').replace(/>/,'>'));
}
@@ -1803,7 +1803,7 @@ function bindJQuery() {
jQuery.cleanData = function(elems) {
var events;
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
- events = jQuery._data(elem, "events");
+ events = jQuery._data(elem, 'events');
if (events && events.$destroy) {
jQuery(elem).triggerHandler('$destroy');
}
@@ -1825,7 +1825,7 @@ function bindJQuery() {
*/
function assertArg(arg, name, reason) {
if (!arg) {
- throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
+ throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
}
return arg;
}
@@ -1847,7 +1847,7 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
*/
function assertNotHasOwnProperty(name, context) {
if (name === 'hasOwnProperty') {
- throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
+ throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
}
}
diff --git a/src/AngularPublic.js b/src/AngularPublic.js
index 342690988d4b..ed7358178204 100644
--- a/src/AngularPublic.js
+++ b/src/AngularPublic.js
@@ -115,9 +115,9 @@
*/
var version = {
full: '"NG_VERSION_FULL"', // all of these placeholder strings will be replaced by grunt's
- major: "NG_VERSION_MAJOR", // package task
- minor: "NG_VERSION_MINOR",
- dot: "NG_VERSION_DOT",
+ major: 'NG_VERSION_MAJOR', // package task
+ minor: 'NG_VERSION_MINOR',
+ dot: 'NG_VERSION_DOT',
codeName: '"NG_VERSION_CODENAME"'
};
diff --git a/src/auto/injector.js b/src/auto/injector.js
index 1b00ecc13705..61eac820e035 100644
--- a/src/auto/injector.js
+++ b/src/auto/injector.js
@@ -665,7 +665,7 @@ function createInjector(modulesToLoad, strictDi) {
if (angular.isString(caller)) {
path.push(caller);
}
- throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
+ throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- '));
})),
instanceCache = {},
protoInstanceInjector =
@@ -704,7 +704,7 @@ function createInjector(modulesToLoad, strictDi) {
provider_ = providerInjector.instantiate(provider_);
}
if (!provider_.$get) {
- throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name);
+ throw $injectorMinErr('pget', 'Provider \'{0}\' must define $get factory method.', name);
}
return (providerCache[name + providerSuffix] = provider_);
}
@@ -713,7 +713,7 @@ function createInjector(modulesToLoad, strictDi) {
return /** @this */ function enforcedReturnValue() {
var result = instanceInjector.invoke(factory, this);
if (isUndefined(result)) {
- throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
+ throw $injectorMinErr('undef', 'Provider \'{0}\' must return a value from $get factory method.', name);
}
return result;
};
@@ -794,7 +794,7 @@ function createInjector(modulesToLoad, strictDi) {
// eslint-disable-next-line no-ex-assign
e = e.message + '\n' + e.stack;
}
- throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}",
+ throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\n{1}',
module, e.stack || e.message || e);
}
});
diff --git a/src/jqLite.js b/src/jqLite.js
index 54d42b033d41..802fdb574a13 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -166,7 +166,7 @@ var wrapMap = {
'col': [2, '
'],
'tr': [2, ''],
'td': [3, ''],
- '_default': [0, "", ""]
+ '_default': [0, '', '']
};
wrapMap.optgroup = wrapMap.option;
@@ -208,10 +208,10 @@ function jqLiteBuildFragment(html, context) {
nodes.push(context.createTextNode(html));
} else {
// Convert html into DOM nodes
- tmp = fragment.appendChild(context.createElement("div"));
- tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
+ tmp = fragment.appendChild(context.createElement('div'));
+ tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase();
wrap = wrapMap[tag] || wrapMap._default;
- tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>$2>") + wrap[2];
+ tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, '<$1>$2>') + wrap[2];
// Descend through wrappers to the right content
i = wrap[0];
@@ -222,12 +222,12 @@ function jqLiteBuildFragment(html, context) {
nodes = concat(nodes, tmp.childNodes);
tmp = fragment.firstChild;
- tmp.textContent = "";
+ tmp.textContent = '';
}
// Remove wrapper from fragment
- fragment.textContent = "";
- fragment.innerHTML = ""; // Clear inner HTML
+ fragment.textContent = '';
+ fragment.innerHTML = ''; // Clear inner HTML
forEach(nodes, function(node) {
fragment.appendChild(node);
});
@@ -409,17 +409,17 @@ function jqLiteData(element, key, value) {
function jqLiteHasClass(element, selector) {
if (!element.getAttribute) return false;
- return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
- indexOf(" " + selector + " ") > -1);
+ return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\n\t]/g, ' ').
+ indexOf(' ' + selector + ' ') > -1);
}
function jqLiteRemoveClass(element, cssClasses) {
if (cssClasses && element.setAttribute) {
forEach(cssClasses.split(' '), function(cssClass) {
element.setAttribute('class', trim(
- (" " + (element.getAttribute('class') || '') + " ")
- .replace(/[\n\t]/g, " ")
- .replace(" " + trim(cssClass) + " ", " "))
+ (' ' + (element.getAttribute('class') || '') + ' ')
+ .replace(/[\n\t]/g, ' ')
+ .replace(' ' + trim(cssClass) + ' ', ' '))
);
});
}
@@ -428,7 +428,7 @@ function jqLiteRemoveClass(element, cssClasses) {
function jqLiteAddClass(element, cssClasses) {
if (cssClasses && element.setAttribute) {
var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
- .replace(/[\n\t]/g, " ");
+ .replace(/[\n\t]/g, ' ');
forEach(cssClasses.split(' '), function(cssClass) {
cssClass = trim(cssClass);
diff --git a/src/loader.js b/src/loader.js
index da71b184f241..e7395558950c 100644
--- a/src/loader.js
+++ b/src/loader.js
@@ -91,9 +91,9 @@ function setupModuleLoader(window) {
}
return ensure(modules, name, function() {
if (!requires) {
- throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
- "the module name or forgot to load it. If registering a module ensure that you " +
- "specify the dependencies as the second argument.", name);
+ throw $injectorMinErr('nomod', 'Module \'{0}\' is not available! You either misspelled ' +
+ 'the module name or forgot to load it. If registering a module ensure that you ' +
+ 'specify the dependencies as the second argument.', name);
}
/** @type {!Array.>} */
diff --git a/src/ng/animate.js b/src/ng/animate.js
index 06c706e7c12b..b55a0376bf4a 100644
--- a/src/ng/animate.js
+++ b/src/ng/animate.js
@@ -223,7 +223,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
*/
this.register = function(name, factory) {
if (name && name.charAt(0) !== '.') {
- throw $animateMinErr('notcsel', "Expecting class selector starting with '.' got '{0}'.", name);
+ throw $animateMinErr('notcsel', 'Expecting class selector starting with \'.\' got \'{0}\'.', name);
}
var key = name + '-animation';
@@ -249,7 +249,7 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
if (arguments.length === 1) {
this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
if (this.$$classNameFilter) {
- var reservedRegex = new RegExp("(\\s+|\\/)" + NG_ANIMATE_CLASSNAME + "(\\s+|\\/)");
+ var reservedRegex = new RegExp('(\\s+|\\/)' + NG_ANIMATE_CLASSNAME + '(\\s+|\\/)');
if (reservedRegex.test(this.$$classNameFilter.toString())) {
throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME);
diff --git a/src/ng/browser.js b/src/ng/browser.js
index ebed151bbcd6..001f09b9c511 100644
--- a/src/ng/browser.js
+++ b/src/ng/browser.js
@@ -177,7 +177,7 @@ function Browser(window, document, $log, $sniffer) {
// the new location.href if a reload happened or if there is a bug like in iOS 9 (see
// https://openradar.appspot.com/22186109).
// - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
- return pendingLocation || location.href.replace(/%27/g,"'");
+ return pendingLocation || location.href.replace(/%27/g,'\'');
}
};
diff --git a/src/ng/cacheFactory.js b/src/ng/cacheFactory.js
index ae121d3bfacb..84e91c9883bd 100644
--- a/src/ng/cacheFactory.js
+++ b/src/ng/cacheFactory.js
@@ -89,7 +89,7 @@ function $CacheFactoryProvider() {
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
- throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId);
+ throw minErr('$cacheFactory')('iid', 'CacheId \'{0}\' is already taken!', cacheId);
}
var size = 0,
diff --git a/src/ng/compile.js b/src/ng/compile.js
index 7e836fd020a3..e61307f3760f 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -987,11 +987,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (!match) {
throw $compileMinErr('iscp',
- "Invalid {3} for directive '{0}'." +
- " Definition: {... {1}: '{2}' ...}",
+ 'Invalid {3} for directive \'{0}\'.' +
+ ' Definition: {... {1}: \'{2}\' ...}',
directiveName, scopeName, definition,
- (isController ? "controller bindings definition" :
- "isolate scope definition"));
+ (isController ? 'controller bindings definition' :
+ 'isolate scope definition'));
}
bindings[scopeName] = {
@@ -1033,12 +1033,12 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (!controller) {
// There is no controller, there may or may not be a controllerAs property
throw $compileMinErr('noctrl',
- "Cannot bind to controller without directive '{0}'s controller.",
+ 'Cannot bind to controller without directive \'{0}\'s controller.',
directiveName);
} else if (!identifierForController(controller, controllerAs)) {
// There is a controller, but no identifier or controllerAs property
throw $compileMinErr('noident',
- "Cannot bind to controller without identifier for directive '{0}'.",
+ 'Cannot bind to controller without identifier for directive \'{0}\'.',
directiveName);
}
}
@@ -1048,11 +1048,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
function assertValidDirectiveName(name) {
var letter = name.charAt(0);
if (!letter || letter !== lowercase(letter)) {
- throw $compileMinErr('baddir', "Directive/Component name '{0}' is invalid. The first character must be a lowercase letter", name);
+ throw $compileMinErr('baddir', 'Directive/Component name \'{0}\' is invalid. The first character must be a lowercase letter', name);
}
if (name !== name.trim()) {
throw $compileMinErr('baddir',
- "Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces",
+ 'Directive/Component name \'{0}\' is invalid. The name should not contain leading or trailing whitespaces',
name);
}
}
@@ -1634,7 +1634,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
this[key] = value = $$sanitizeUri(value, key === 'src');
} else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) {
// sanitize img[srcset] values
- var result = "";
+ var result = '';
// first check if there are spaces because it's not the same pattern
var trimmedSrcset = trim(value);
@@ -1652,7 +1652,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// sanitize the uri
result += $$sanitizeUri(trim(rawUris[innerIdx]), true);
// add the descriptor
- result += (" " + trim(rawUris[innerIdx + 1]));
+ result += (' ' + trim(rawUris[innerIdx + 1]));
}
// split the last item into uri and descriptor
@@ -1663,7 +1663,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// and add the last descriptor if any
if (lastTuple.length === 2) {
- result += (" " + trim(lastTuple[1]));
+ result += (' ' + trim(lastTuple[1]));
}
this[key] = value = result;
}
@@ -1736,7 +1736,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`
// so we have to jump through some hoops to get such an attribute
// https://github.com/angular/angular.js/pull/13318
- specialAttrHolder.innerHTML = "";
+ specialAttrHolder.innerHTML = '';
var attributes = specialAttrHolder.firstChild.attributes;
var attribute = attributes[0];
// We have to remove the attribute from its container element before we can add it to the destination element
@@ -2159,7 +2159,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
do {
if (!node) {
throw $compileMinErr('uterdir',
- "Unterminated attribute, found '{0}' but no matching '{1}' found.",
+ 'Unterminated attribute, found \'{0}\' but no matching \'{1}\' found.',
attrStart, attrEnd);
}
if (node.nodeType === NODE_TYPE_ELEMENT) {
@@ -2334,7 +2334,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (!directive.templateUrl && directive.controller) {
directiveValue = directive.controller;
controllerDirectives = controllerDirectives || createMap();
- assertNoDuplicate("'" + directiveName + "' controller",
+ assertNoDuplicate('\'' + directiveName + '\' controller',
controllerDirectives[directiveName], directive, $compileNode);
controllerDirectives[directiveName] = directive;
}
@@ -2472,7 +2472,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
throw $compileMinErr('tplrt',
- "Template for directive '{0}' must have exactly one root element. {1}",
+ 'Template for directive \'{0}\' must have exactly one root element. {1}',
directiveName, '');
}
@@ -2796,7 +2796,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (!value && !optional) {
throw $compileMinErr('ctreq',
- "Controller '{0}', required by directive '{1}', can't be found!",
+ 'Controller \'{0}\', required by directive \'{1}\', can\'t be found!',
name, directiveName);
}
} else if (isArray(require)) {
@@ -2996,7 +2996,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
throw $compileMinErr('tplrt',
- "Template for directive '{0}' must have exactly one root element. {1}",
+ 'Template for directive \'{0}\' must have exactly one root element. {1}',
origAsyncDirective.name, templateUrl);
}
@@ -3147,17 +3147,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
function getTrustedContext(node, attrNormalizedName) {
- if (attrNormalizedName === "srcdoc") {
+ if (attrNormalizedName === 'srcdoc') {
return $sce.HTML;
}
var tag = nodeName_(node);
// maction[xlink:href] can source SVG. It's not limited to .
- if (attrNormalizedName === "xlinkHref" ||
- (tag === "form" && attrNormalizedName === "action") ||
+ if (attrNormalizedName === 'xlinkHref' ||
+ (tag === 'form' && attrNormalizedName === 'action') ||
// links can be stylesheets or imports, which can run script in the current origin
- (tag === "link" && attrNormalizedName === "href") ||
- (tag !== "img" && (attrNormalizedName === "src" ||
- attrNormalizedName === "ngSrc"))) {
+ (tag === 'link' && attrNormalizedName === 'href') ||
+ (tag !== 'img' && (attrNormalizedName === 'src' ||
+ attrNormalizedName === 'ngSrc'))) {
return $sce.RESOURCE_URL;
}
}
@@ -3173,16 +3173,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (!interpolateFn) return;
- if (name === "multiple" && nodeName_(node) === "select") {
- throw $compileMinErr("selmulti",
- "Binding to the 'multiple' attribute is not supported. Element: {0}",
+ if (name === 'multiple' && nodeName_(node) === 'select') {
+ throw $compileMinErr('selmulti',
+ 'Binding to the \'multiple\' attribute is not supported. Element: {0}',
startingTag(node));
}
if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
throw $compileMinErr('nodomevents',
- "Interpolations for HTML DOM event attributes are disallowed. Please use the " +
- "ng- versions (such as ng-click instead of onclick) instead.");
+ 'Interpolations for HTML DOM event attributes are disallowed. Please use the ' +
+ 'ng- versions (such as ng-click instead of onclick) instead.');
}
directives.push({
@@ -3383,7 +3383,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// reset the change, or we will throw this exception on every $digest
lastValue = destination[scopeName] = parentGet(scope);
throw $compileMinErr('nonassign',
- "Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!",
+ 'Expression \'{0}\' in attribute \'{1}\' used with directive \'{2}\' is non-assignable!',
attrs[attrName], attrName, directive.name);
};
lastValue = destination[scopeName] = parentGet(scope);
diff --git a/src/ng/controller.js b/src/ng/controller.js
index 39f5c319e820..b1cbdc5cf91d 100644
--- a/src/ng/controller.js
+++ b/src/ng/controller.js
@@ -112,8 +112,8 @@ function $ControllerProvider() {
match = expression.match(CNTRL_REG);
if (!match) {
throw $controllerMinErr('ctrlfmt',
- "Badly formed controller string '{0}'. " +
- "Must match `__name__ as __id__` or `__name__`.", expression);
+ 'Badly formed controller string \'{0}\'. ' +
+ 'Must match `__name__ as __id__` or `__name__`.', expression);
}
constructor = match[1];
identifier = identifier || match[3];
@@ -172,7 +172,7 @@ function $ControllerProvider() {
function addIdentifier(locals, identifier, instance, name) {
if (!(locals && isObject(locals.$scope))) {
throw minErr('$controller')('noscp',
- "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
+ 'Cannot export controller \'{0}\' as \'{1}\'! No $scope object provided via `locals`.',
name, identifier);
}
diff --git a/src/ng/directive/attrs.js b/src/ng/directive/attrs.js
index 0e3233ee9f35..adc398425fd9 100644
--- a/src/ng/directive/attrs.js
+++ b/src/ng/directive/attrs.js
@@ -346,7 +346,7 @@ var ngAttributeAliasDirectives = {};
// boolean attrs are evaluated
forEach(BOOLEAN_ATTR, function(propName, attrName) {
// binding to multiple is not supported
- if (propName === "multiple") return;
+ if (propName === 'multiple') return;
function defaultLinkFn(scope, element, attr) {
scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
@@ -383,10 +383,10 @@ forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
link: function(scope, element, attr) {
//special case ngPattern when a literal regular expression value
//is used as the expression (this way we don't have to watch anything).
- if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) === "/") {
+ if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') {
var match = attr.ngPattern.match(REGEX_STRING_REGEXP);
if (match) {
- attr.$set("ngPattern", new RegExp(match[1], match[2]));
+ attr.$set('ngPattern', new RegExp(match[1], match[2]));
return;
}
}
diff --git a/src/ng/directive/ngController.js b/src/ng/directive/ngController.js
index 565d81c7c6e4..cd3bfed63a4c 100644
--- a/src/ng/directive/ngController.js
+++ b/src/ng/directive/ngController.js
@@ -86,7 +86,7 @@
* .controller('SettingsController1', SettingsController1);
*
* function SettingsController1() {
- * this.name = "John Smith";
+ * this.name = 'John Smith';
* this.contacts = [
* {type: 'phone', value: '408 555 1212'},
* {type: 'email', value: 'john.smith@example.org'}
@@ -170,7 +170,7 @@
* .controller('SettingsController2', ['$scope', SettingsController2]);
*
* function SettingsController2($scope) {
- * $scope.name = "John Smith";
+ * $scope.name = 'John Smith';
* $scope.contacts = [
* {type:'phone', value:'408 555 1212'},
* {type:'email', value:'john.smith@example.org'}
diff --git a/src/ng/directive/ngModel.js b/src/ng/directive/ngModel.js
index 9dc344519de4..6ef8ba408187 100644
--- a/src/ng/directive/ngModel.js
+++ b/src/ng/directive/ngModel.js
@@ -271,7 +271,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
}
};
} else if (!parsedNgModel.assign) {
- throw ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}",
+ throw ngModelMinErr('nonassign', 'Expression \'{0}\' is non-assignable. Element: {1}',
$attr.ngModel, startingTag($element));
}
};
@@ -640,7 +640,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
var promise = validator(modelValue, viewValue);
if (!isPromiseLike(promise)) {
throw ngModelMinErr('nopromise',
- "Expected asynchronous validator to return a promise but got '{0}' instead.", promise);
+ 'Expected asynchronous validator to return a promise but got \'{0}\' instead.', promise);
}
setValidity(name, undefined);
validatorPromises.push(promise.then(function() {
diff --git a/src/ng/directive/ngOptions.js b/src/ng/directive/ngOptions.js
index 8a1d6739d260..16a23b18ca17 100644
--- a/src/ng/directive/ngOptions.js
+++ b/src/ng/directive/ngOptions.js
@@ -253,9 +253,9 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
var match = optionsExp.match(NG_OPTIONS_REGEXP);
if (!(match)) {
throw ngOptionsMinErr('iexp',
- "Expected expression in form of " +
- "'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
- " but got '{0}'. Element: {1}",
+ 'Expected expression in form of ' +
+ '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' +
+ ' but got \'{0}\'. Element: {1}',
optionsExp, startingTag(selectElement));
}
diff --git a/src/ng/directive/ngPluralize.js b/src/ng/directive/ngPluralize.js
index 1cbb8a595d0f..8d3a8a8cc48d 100644
--- a/src/ng/directive/ngPluralize.js
+++ b/src/ng/directive/ngPluralize.js
@@ -221,7 +221,7 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale,
var whenExpFn = whensExpFns[count];
if (isUndefined(whenExpFn)) {
if (newVal != null) {
- $log.debug("ngPluralize: no rule defined for '" + count + "' in " + whenExp);
+ $log.debug('ngPluralize: no rule defined for \'' + count + '\' in ' + whenExp);
}
watchRemover = noop;
updateElementText();
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js
index 26d357b9487a..213cd3bc583c 100644
--- a/src/ng/directive/ngRepeat.js
+++ b/src/ng/directive/ngRepeat.js
@@ -363,7 +363,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
if (!match) {
- throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
+ throw ngRepeatMinErr('iexp', 'Expected expression in form of \'_item_ in _collection_[ track by _id_]\' but got \'{0}\'.',
expression);
}
@@ -375,7 +375,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
match = lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);
if (!match) {
- throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
+ throw ngRepeatMinErr('iidexp', '\'_item_\' in \'_item_ in _collection_\' should be an identifier or \'(_key_, _value_)\' expression, but got \'{0}\'.',
lhs);
}
var valueIdentifier = match[3] || match[1];
@@ -383,7 +383,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||
/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs))) {
- throw ngRepeatMinErr('badident', "alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",
+ throw ngRepeatMinErr('badident', 'alias \'{0}\' is invalid --- must be a valid JS identifier which is not a reserved name.',
aliasAs);
}
@@ -479,7 +479,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
if (block && block.scope) lastBlockMap[block.id] = block;
});
throw ngRepeatMinErr('dupes',
- "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",
+ 'Duplicates in a repeater are not allowed. Use \'track by\' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}',
expression, trackById, value);
} else {
// new never before seen block
diff --git a/src/ng/directive/ngTransclude.js b/src/ng/directive/ngTransclude.js
index ea21eb155ad0..f19c251fc3b6 100644
--- a/src/ng/directive/ngTransclude.js
+++ b/src/ng/directive/ngTransclude.js
@@ -139,7 +139,7 @@
* })
* .controller('ExampleController', ['$scope', function($scope) {
* $scope.title = 'Lorem Ipsum';
- * $scope.link = "https://google.com";
+ * $scope.link = 'https://google.com';
* $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
* }]);
*
diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js
index f35911d0965d..8d8f221a56cb 100644
--- a/src/ng/filter/filters.js
+++ b/src/ng/filter/filters.js
@@ -395,7 +395,7 @@ function dateStrGetter(name, shortForm, standAlone) {
function timeZoneGetter(date, formats, offset) {
var zone = -1 * offset;
- var paddedZone = (zone >= 0) ? "+" : "";
+ var paddedZone = (zone >= 0) ? '+' : '';
paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +
padNumber(Math.abs(zone % 60), 2);
@@ -641,7 +641,7 @@ function dateFilter($locale) {
forEach(parts, function(value) {
fn = DATE_FORMATS[value];
text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)
- : value === "''" ? "'" : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
+ : value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
});
return text;
diff --git a/src/ng/http.js b/src/ng/http.js
index 00b9f71c2f64..0cbc72571a32 100644
--- a/src/ng/http.js
+++ b/src/ng/http.js
@@ -895,7 +895,7 @@ function $HttpProvider() {
$scope.status = response.status;
$scope.data = response.data;
}, function(response) {
- $scope.data = response.data || "Request failed";
+ $scope.data = response.data || 'Request failed';
$scope.status = response.status;
});
};
diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js
index 5d3604271f25..501c1de86c73 100644
--- a/src/ng/httpBackend.js
+++ b/src/ng/httpBackend.js
@@ -64,7 +64,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
var jsonpDone = jsonpReq(url, callbackPath, function(status, text) {
// jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING)
var response = (status === 200) && callbacks.getResponse(callbackPath);
- completeRequest(callback, status, response, "", text);
+ completeRequest(callback, status, response, '', text);
callbacks.removeCallback(callbackPath);
});
} else {
@@ -177,7 +177,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
// - fetches local scripts via XHR and evals them
// - adds and immediately removes script elements from the document
var script = rawDocument.createElement('script'), callback = null;
- script.type = "text/javascript";
+ script.type = 'text/javascript';
script.src = url;
script.async = true;
@@ -187,14 +187,14 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
rawDocument.body.removeChild(script);
script = null;
var status = -1;
- var text = "unknown";
+ var text = 'unknown';
if (event) {
- if (event.type === "load" && !callbacks.wasCalled(callbackPath)) {
- event = { type: "error" };
+ if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) {
+ event = { type: 'error' };
}
text = event.type;
- status = event.type === "error" ? 404 : 200;
+ status = event.type === 'error' ? 404 : 200;
}
if (done) {
diff --git a/src/ng/interpolate.js b/src/ng/interpolate.js
index 9414ae22b5c3..ebfdb72c5f26 100644
--- a/src/ng/interpolate.js
+++ b/src/ng/interpolate.js
@@ -3,13 +3,13 @@
var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');
$interpolateMinErr.throwNoconcat = function(text) {
throw $interpolateMinErr('noconcat',
- "Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
- "interpolations that concatenate multiple expressions when a trusted value is " +
- "required. See http://docs.angularjs.org/api/ng.$sce", text);
+ 'Error while interpolating: {0}\nStrict Contextual Escaping disallows ' +
+ 'interpolations that concatenate multiple expressions when a trusted value is ' +
+ 'required. See http://docs.angularjs.org/api/ng.$sce', text);
};
$interpolateMinErr.interr = function(text, err) {
- return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString());
+ return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
};
/**
diff --git a/src/ng/location.js b/src/ng/location.js
index 7e131182cf1a..31d1b2735caf 100644
--- a/src/ng/location.js
+++ b/src/ng/location.js
@@ -829,7 +829,7 @@ function $LocationProvider() {
if (html5Mode.enabled) {
if (!baseHref && html5Mode.requireBase) {
throw $locationMinErr('nobase',
- "$location in HTML5 mode requires a tag to be present!");
+ '$location in HTML5 mode requires a tag to be present!');
}
appBase = serverBase(initialUrl) + (baseHref || '/');
LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
diff --git a/src/ng/parse.js b/src/ng/parse.js
index 3a81c1e990b8..a008dd1e4fea 100644
--- a/src/ng/parse.js
+++ b/src/ng/parse.js
@@ -57,9 +57,9 @@ var objectValueOf = OBJECT_CTOR_PROTO.valueOf;
function ensureSafeMemberName(name, fullExpression) {
- if (name === "__defineGetter__" || name === "__defineSetter__"
- || name === "__lookupGetter__" || name === "__lookupSetter__"
- || name === "__proto__") {
+ if (name === '__defineGetter__' || name === '__defineSetter__'
+ || name === '__lookupGetter__' || name === '__lookupSetter__'
+ || name === '__proto__') {
throw $parseMinErr('isecfld',
'Attempting to access a disallowed field in Angular expressions! '
+ 'Expression: {0}', fullExpression);
@@ -149,7 +149,7 @@ function ensureSafeAssignContext(obj, fullExpression) {
var OPERATORS = createMap();
forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });
-var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
+var ESCAPE = {'n':'\n', 'f':'\f', 'r':'\r', 't':'\t', 'v':'\v', '\'':'\'', '"':'"'};
/////////////////////////////////////////
@@ -172,7 +172,7 @@ Lexer.prototype = {
while (this.index < this.text.length) {
var ch = this.text.charAt(this.index);
- if (ch === '"' || ch === "'") {
+ if (ch === '"' || ch === '\'') {
this.readString(ch);
} else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {
this.readNumber();
@@ -211,7 +211,7 @@ Lexer.prototype = {
},
isNumber: function(ch) {
- return ('0' <= ch && ch <= '9') && typeof ch === "string";
+ return ('0' <= ch && ch <= '9') && typeof ch === 'string';
},
isWhitespace: function(ch) {
@@ -635,7 +635,7 @@ AST.prototype = {
this.consume(':');
property.value = this.expression();
} else {
- this.throwError("invalid key", this.peek());
+ this.throwError('invalid key', this.peek());
}
properties.push(property);
} while (this.expect(','));
@@ -1360,7 +1360,7 @@ ASTCompiler.prototype = {
},
escape: function(value) {
- if (isString(value)) return "'" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + "'";
+ if (isString(value)) return '\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\'';
if (isNumber(value)) return value.toString();
if (value === true) return 'true';
if (value === false) return 'false';
diff --git a/src/ng/q.js b/src/ng/q.js
index 1b1802c6e82a..8664c992a43c 100644
--- a/src/ng/q.js
+++ b/src/ng/q.js
@@ -325,11 +325,11 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
return result.promise;
},
- "catch": function(callback) {
+ 'catch': function(callback) {
return this.then(null, callback);
},
- "finally": function(callback, progressBack) {
+ 'finally': function(callback, progressBack) {
return this.then(function(value) {
return handleCallback(value, true, callback);
}, function(error) {
@@ -420,7 +420,7 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
if (val === this.promise) {
this.$$reject($qMinErr(
'qcycle',
- "Expected promise to be resolved with value other than itself '{0}'",
+ 'Expected promise to be resolved with value other than itself \'{0}\'',
val));
} else {
this.$$resolve(val);
@@ -666,7 +666,7 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
var $Q = function Q(resolver) {
if (!isFunction(resolver)) {
- throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver);
+ throw $qMinErr('norslvr', 'Expected resolverFn, got \'{0}\'', resolver);
}
var deferred = new Deferred();
diff --git a/src/ng/sce.js b/src/ng/sce.js
index b2140e21bcbb..f16aee5597a8 100644
--- a/src/ng/sce.js
+++ b/src/ng/sce.js
@@ -612,7 +612,7 @@ function $SceDelegateProvider() {
* .controller('AppController', ['$http', '$templateCache', '$sce',
* function AppController($http, $templateCache, $sce) {
* var self = this;
- * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) {
+ * $http.get('test_data.json', {cache: $templateCache}).success(function(userComments) {
* self.userComments = userComments;
* });
* self.explicitlyTrustedHtml = $sce.trustAsHtml(
@@ -1054,13 +1054,13 @@ function $SceProvider() {
forEach(SCE_CONTEXTS, function(enumValue, name) {
var lName = lowercase(name);
- sce[camelCase("parse_as_" + lName)] = function(expr) {
+ sce[camelCase('parse_as_' + lName)] = function(expr) {
return parse(enumValue, expr);
};
- sce[camelCase("get_trusted_" + lName)] = function(value) {
+ sce[camelCase('get_trusted_' + lName)] = function(value) {
return getTrusted(enumValue, value);
};
- sce[camelCase("trust_as_" + lName)] = function(value) {
+ sce[camelCase('trust_as_' + lName)] = function(value) {
return trustAs(enumValue, value);
};
});
diff --git a/src/ng/urlUtils.js b/src/ng/urlUtils.js
index ee58b435f3e9..60a40b7caa87 100644
--- a/src/ng/urlUtils.js
+++ b/src/ng/urlUtils.js
@@ -6,7 +6,7 @@
// doesn't know about mocked locations and resolves URLs to the real document - which is
// exactly the behavior needed here. There is little value is mocking these out for this
// service.
-var urlParsingNode = window.document.createElement("a");
+var urlParsingNode = window.document.createElement('a');
var originUrl = urlResolve(window.location.href);
@@ -61,7 +61,7 @@ function urlResolve(url) {
if (msie) {
// Normalize before parse. Refer Implementation Notes on why this is
// done in two steps on IE.
- urlParsingNode.setAttribute("href", href);
+ urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
diff --git a/src/ngAnimate/animateCss.js b/src/ngAnimate/animateCss.js
index 8127222e3e83..27619d67c29b 100644
--- a/src/ngAnimate/animateCss.js
+++ b/src/ngAnimate/animateCss.js
@@ -361,7 +361,7 @@ var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animatePro
var parentCounter = 0;
function gcsHashFn(node, extraClasses) {
- var KEY = "$$ngAnimateParentKey";
+ var KEY = '$$ngAnimateParentKey';
var parentNode = node.parentNode;
var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);
return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;
@@ -632,7 +632,7 @@ var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animatePro
if (options.delay != null) {
var delayStyle;
- if (typeof options.delay !== "boolean") {
+ if (typeof options.delay !== 'boolean') {
delayStyle = parseFloat(options.delay);
// number in options.delay means we have to recalculate the delay for the closing timeout
maxDelay = Math.max(delayStyle, 0);
@@ -915,7 +915,7 @@ var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animatePro
}
if (flags.applyAnimationDelay) {
- relativeDelay = typeof options.delay !== "boolean" && truthyTimingValue(options.delay)
+ relativeDelay = typeof options.delay !== 'boolean' && truthyTimingValue(options.delay)
? parseFloat(options.delay)
: relativeDelay;
diff --git a/src/ngAnimate/module.js b/src/ngAnimate/module.js
index 402e2c6752a8..b1167608c099 100644
--- a/src/ngAnimate/module.js
+++ b/src/ngAnimate/module.js
@@ -552,16 +552,16 @@
}])
.run(['$rootScope', function($rootScope) {
$rootScope.records = [
- { id:1, title: "Miss Beulah Roob" },
- { id:2, title: "Trent Morissette" },
- { id:3, title: "Miss Ava Pouros" },
- { id:4, title: "Rod Pouros" },
- { id:5, title: "Abdul Rice" },
- { id:6, title: "Laurie Rutherford Sr." },
- { id:7, title: "Nakia McLaughlin" },
- { id:8, title: "Jordon Blanda DVM" },
- { id:9, title: "Rhoda Hand" },
- { id:10, title: "Alexandrea Sauer" }
+ { id: 1, title: 'Miss Beulah Roob' },
+ { id: 2, title: 'Trent Morissette' },
+ { id: 3, title: 'Miss Ava Pouros' },
+ { id: 4, title: 'Rod Pouros' },
+ { id: 5, title: 'Abdul Rice' },
+ { id: 6, title: 'Laurie Rutherford Sr.' },
+ { id: 7, title: 'Nakia McLaughlin' },
+ { id: 8, title: 'Jordon Blanda DVM' },
+ { id: 9, title: 'Rhoda Hand' },
+ { id: 10, title: 'Alexandrea Sauer' }
];
}])
.controller('HomeController', [function() {
diff --git a/src/ngAnimate/shared.js b/src/ngAnimate/shared.js
index adfd35fc4668..f65ec61b0996 100644
--- a/src/ngAnimate/shared.js
+++ b/src/ngAnimate/shared.js
@@ -58,7 +58,7 @@ var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;
var ngMinErr = angular.$$minErr('ng');
function assertArg(arg, name, reason) {
if (!arg) {
- throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
+ throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
}
return arg;
}
diff --git a/src/ngCookies/cookieWriter.js b/src/ngCookies/cookieWriter.js
index 2c8b6fe654d0..33daf8fb74cd 100644
--- a/src/ngCookies/cookieWriter.js
+++ b/src/ngCookies/cookieWriter.js
@@ -40,9 +40,9 @@ function $$CookieWriter($document, $log, $browser) {
// - 4096 bytes per cookie
var cookieLength = str.length + 1;
if (cookieLength > 4096) {
- $log.warn("Cookie '" + name +
- "' possibly not set or overflowed because it was too large (" +
- cookieLength + " > 4096 bytes)!");
+ $log.warn('Cookie \'' + name +
+ '\' possibly not set or overflowed because it was too large (' +
+ cookieLength + ' > 4096 bytes)!');
}
return str;
diff --git a/src/ngMessageFormat/messageFormatParser.js b/src/ngMessageFormat/messageFormatParser.js
index 8621a3ee8727..cabacd2bb90d 100644
--- a/src/ngMessageFormat/messageFormatParser.js
+++ b/src/ngMessageFormat/messageFormatParser.js
@@ -146,7 +146,7 @@ MessageFormatParser.prototype.errorExpecting = function errorExpecting() {
position.line, position.column, this.text);
}
var word = match[1];
- if (word === "select" || word === "plural") {
+ if (word === 'select' || word === 'plural') {
position = indexToLineAndColumn(this.text, this.index);
throw $interpolateMinErr('reqcomma',
'Expected a comma after the keyword “{0}” at line {1}, column {2} of text “{3}”',
@@ -174,7 +174,7 @@ MessageFormatParser.prototype.ruleString = function ruleString() {
MessageFormatParser.prototype.startStringAtMatch = function startStringAtMatch(match) {
this.stringStartIndex = match.index;
this.stringQuote = match[0];
- this.stringInterestsRe = this.stringQuote === "'" ? SQUOTED_STRING_INTEREST_RE : DQUOTED_STRING_INTEREST_RE;
+ this.stringInterestsRe = this.stringQuote === '\'' ? SQUOTED_STRING_INTEREST_RE : DQUOTED_STRING_INTEREST_RE;
this.rule = this.ruleInsideString;
};
@@ -201,8 +201,8 @@ MessageFormatParser.prototype.rulePluralOrSelect = function rulePluralOrSelect()
}
var argType = match[1];
switch (argType) {
- case "plural": this.rule = this.rulePluralStyle; break;
- case "select": this.rule = this.ruleSelectStyle; break;
+ case 'plural': this.rule = this.rulePluralStyle; break;
+ case 'select': this.rule = this.ruleSelectStyle; break;
default: this.errorInParseLogic();
}
};
@@ -220,7 +220,7 @@ MessageFormatParser.prototype.ruleSelectStyle = function ruleSelectStyle() {
};
var NUMBER_RE = /[0]|(?:[1-9][0-9]*)/g;
-var PLURAL_OFFSET_RE = new RegExp("\\s*offset\\s*:\\s*(" + NUMBER_RE.source + ")", "g");
+var PLURAL_OFFSET_RE = new RegExp('\\s*offset\\s*:\\s*(' + NUMBER_RE.source + ')', 'g');
MessageFormatParser.prototype.rulePluralOffset = function rulePluralOffset() {
var match = this.matchRe(PLURAL_OFFSET_RE);
@@ -251,7 +251,7 @@ MessageFormatParser.prototype.ruleSelectKeyword = function ruleSelectKeyword() {
this.rule = this.ruleMessageText;
};
-var EXPLICIT_VALUE_OR_KEYWORD_RE = new RegExp("\\s*(?:(?:=(" + NUMBER_RE.source + "))|(\\w+))", "g");
+var EXPLICIT_VALUE_OR_KEYWORD_RE = new RegExp('\\s*(?:(?:=(' + NUMBER_RE.source + '))|(\\w+))', 'g');
MessageFormatParser.prototype.rulePluralValueOrKeyword = function rulePluralValueOrKeyword() {
var match = this.matchRe(EXPLICIT_VALUE_OR_KEYWORD_RE);
if (match == null) {
@@ -322,20 +322,20 @@ MessageFormatParser.prototype.ruleInInterpolationOrMessageText = function ruleIn
this.rule = null;
return;
}
- if (token[0] === "\\") {
+ if (token[0] === '\\') {
// unescape next character and continue
this.interpolationParts.addText(this.textPart + token[1]);
return;
}
this.interpolationParts.addText(this.textPart);
- if (token === "{{") {
+ if (token === '{{') {
this.pushState();
this.ruleStack.push(this.ruleEndMustacheInInterpolationOrMessage);
this.rule = this.ruleEnteredMustache;
- } else if (token === "}") {
+ } else if (token === '}') {
this.choices[this.choiceKey] = this.interpolationParts.toParsedFn(/*mustHaveExpression=*/false, this.text);
this.rule = this.ruleChoiceKeyword;
- } else if (token === "#") {
+ } else if (token === '#') {
this.interpolationParts.addExpressionFn(this.expressionMinusOffsetFn);
} else {
this.errorInParseLogic();
@@ -359,7 +359,7 @@ MessageFormatParser.prototype.ruleInInterpolation = function ruleInInterpolation
return;
}
var token = match[0];
- if (token[0] === "\\") {
+ if (token[0] === '\\') {
// unescape next character and continue
this.interpolationParts.addText(this.text.substring(currentIndex, match.index) + token[1]);
return;
@@ -425,18 +425,18 @@ MessageFormatParser.prototype.ruleAngularExpression = function ruleAngularExpres
function getEndOperator(opBegin) {
switch (opBegin) {
- case "{": return "}";
- case "[": return "]";
- case "(": return ")";
+ case '{': return '}';
+ case '[': return ']';
+ case '(': return ')';
default: return null;
}
}
function getBeginOperator(opEnd) {
switch (opEnd) {
- case "}": return "{";
- case "]": return "[";
- case ")": return "(";
+ case '}': return '{';
+ case ']': return '[';
+ case ')': return '(';
default: return null;
}
}
@@ -470,12 +470,12 @@ MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularEx
this.getEndOperator(innermostOperator), this.text);
}
var operator = match[0];
- if (operator === "'" || operator === '"') {
+ if (operator === '\'' || operator === '"') {
this.ruleStack.push(this.ruleInAngularExpression);
this.startStringAtMatch(match);
return;
}
- if (operator === ",") {
+ if (operator === ',') {
if (this.trustedContext) {
position = indexToLineAndColumn(this.text, this.index);
throw $interpolateMinErr('unsafe',
diff --git a/src/ngMessageFormat/messageFormatSelector.js b/src/ngMessageFormat/messageFormatSelector.js
index b672dca0d23a..749d9fd861f4 100644
--- a/src/ngMessageFormat/messageFormatSelector.js
+++ b/src/ngMessageFormat/messageFormatSelector.js
@@ -17,7 +17,7 @@ function MessageSelectorBase(expressionFn, choices) {
var self = this;
this.expressionFn = expressionFn;
this.choices = choices;
- if (choices["other"] === undefined) {
+ if (choices['other'] === undefined) {
throw $interpolateMinErr('reqother', '“other” is a required option.');
}
this.parsedFn = function(context) { return self.getResult(context); };
@@ -91,7 +91,7 @@ SelectMessageProto.prototype = MessageSelectorBase.prototype;
SelectMessage.prototype = new SelectMessageProto();
SelectMessage.prototype.categorizeValue = function categorizeSelectValue(value) {
- return (this.choices[value] !== undefined) ? value : "other";
+ return (this.choices[value] !== undefined) ? value : 'other';
};
/**
@@ -111,11 +111,11 @@ PluralMessageProto.prototype = MessageSelectorBase.prototype;
PluralMessage.prototype = new PluralMessageProto();
PluralMessage.prototype.categorizeValue = function categorizePluralValue(value) {
if (isNaN(value)) {
- return "other";
+ return 'other';
} else if (this.choices[value] !== undefined) {
return value;
} else {
var category = this.pluralCat(value - this.offset);
- return (this.choices[category] !== undefined) ? category : "other";
+ return (this.choices[category] !== undefined) ? category : 'other';
}
};
diff --git a/src/ngMessageFormat/messageFormatService.js b/src/ngMessageFormat/messageFormatService.js
index a8ad661c611a..458130f879dc 100644
--- a/src/ngMessageFormat/messageFormatService.js
+++ b/src/ngMessageFormat/messageFormatService.js
@@ -54,9 +54,9 @@
* this.gender = gender;
* }
*
- * var alice = new Person("Alice", "female"),
- * bob = new Person("Bob", "male"),
- * ashley = new Person("Ashley", "");
+ * var alice = new Person('Alice', 'female'),
+ * bob = new Person('Bob', 'male'),
+ * ashley = new Person('Ashley', '');
*
* angular.module('msgFmtExample', ['ngMessageFormat'])
* .controller('AppController', ['$scope', function($scope) {
@@ -97,11 +97,11 @@
* this.gender = gender;
* }
*
- * var alice = new Person("Alice", "female"),
- * bob = new Person("Bob", "male"),
- * sarah = new Person("Sarah", "female"),
- * harry = new Person("Harry Potter", "male"),
- * ashley = new Person("Ashley", "");
+ * var alice = new Person('Alice', 'female'),
+ * bob = new Person('Bob', 'male'),
+ * sarah = new Person('Sarah', 'female'),
+ * harry = new Person('Harry Potter', 'male'),
+ * ashley = new Person('Ashley', '');
*
* angular.module('msgFmtExample', ['ngMessageFormat'])
* .controller('AppController', ['$scope', function($scope) {
@@ -157,10 +157,10 @@
* this.gender = gender;
* }
*
- * var alice = new Person("Alice", "female"),
- * bob = new Person("Bob", "male"),
- * harry = new Person("Harry Potter", "male"),
- * ashley = new Person("Ashley", "");
+ * var alice = new Person('Alice', 'female'),
+ * bob = new Person('Bob', 'male'),
+ * harry = new Person('Harry Potter', 'male'),
+ * ashley = new Person('Ashley', '');
*
* angular.module('msgFmtExample', ['ngMessageFormat'])
* .controller('AppController', ['$scope', function($scope) {
@@ -200,7 +200,7 @@ var $$MessageFormatFactory = ['$parse', '$locale', '$sce', '$exceptionHandler',
}];
var $$interpolateDecorator = ['$$messageFormat', '$delegate', function $$interpolateDecorator($$messageFormat, $interpolate) {
- if ($interpolate['startSymbol']() !== "{{" || $interpolate['endSymbol']() !== "}}") {
+ if ($interpolate['startSymbol']() !== '{{' || $interpolate['endSymbol']() !== '}}') {
throw $interpolateMinErr('nochgmustache', 'angular-message-format.js currently does not allow you to use custom start and end symbols for interpolation.');
}
var interpolate = $$messageFormat['interpolate'];
diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js
index c94a4a752cc3..93f99c62f5bd 100644
--- a/src/ngMock/angular-mocks.js
+++ b/src/ngMock/angular-mocks.js
@@ -33,7 +33,7 @@ angular.mock.$Browser = function() {
var self = this;
this.isMock = true;
- self.$$url = "http://server/";
+ self.$$url = 'http://server/';
self.$$lastUrl = self.$$url; // used by url polling fn
self.pollFns = [];
@@ -250,14 +250,14 @@ angular.mock.$ExceptionHandlerProvider = function() {
} else {
errors.push([].slice.call(arguments, 0));
}
- if (mode === "rethrow") {
+ if (mode === 'rethrow') {
throw e;
}
};
handler.errors = errors;
break;
default:
- throw new Error("Unknown mode '" + mode + "', only 'log'/'rethrow' modes are allowed!");
+ throw new Error('Unknown mode \'' + mode + '\', only \'log\'/\'rethrow\' modes are allowed!');
}
};
@@ -407,8 +407,8 @@ angular.mock.$LogProvider = function() {
});
});
if (errors.length) {
- errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
- "an expected log message was not checked and removed:");
+ errors.unshift('Expected $log to be empty! Either a message was logged unexpectedly, or ' +
+ 'an expected log message was not checked and removed:');
errors.push('');
throw new Error(errors.join('\n---------\n'));
}
@@ -643,8 +643,8 @@ angular.mock.TzDate = function(offset, timestamp) {
if (isNaN(timestamp)) {
// eslint-disable-next-line no-throw-literal
throw {
- name: "Illegal Argument",
- message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
+ name: 'Illegal Argument',
+ message: 'Arg \'' + tsStr + '\' passed into TzDate constructor is not a valid date string'
};
}
} else {
@@ -750,7 +750,7 @@ angular.mock.TzDate = function(offset, timestamp) {
angular.forEach(unimplementedMethods, function(methodName) {
self[methodName] = function() {
- throw new Error("Method '" + methodName + "' is not implemented in the TzDate mock");
+ throw new Error('Method \'' + methodName + '\' is not implemented in the TzDate mock');
};
});
@@ -1909,7 +1909,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
function assertArgDefined(args, index, name) {
if (args.length > index && angular.isUndefined(args[index])) {
- throw new Error("Undefined argument `" + name + "`; the argument is provided but not defined");
+ throw new Error('Undefined argument `' + name + '`; the argument is provided but not defined');
}
}
@@ -1989,7 +1989,7 @@ function MockHttpExpectation(method, url, data, headers, keys) {
var obj = {}, key_value, key,
queryStr = u.indexOf('?') > -1
? u.substring(u.indexOf('?') + 1)
- : "";
+ : '';
angular.forEach(queryStr.split('&'), function(keyValue) {
if (keyValue) {
@@ -2879,14 +2879,14 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
*/
module.sharedInjector = function() {
if (!(module.$$beforeAllHook && module.$$afterAllHook)) {
- throw Error("sharedInjector() cannot be used unless your test runner defines beforeAll/afterAll");
+ throw Error('sharedInjector() cannot be used unless your test runner defines beforeAll/afterAll');
}
var initialized = false;
module.$$beforeAllHook(/** @this */ function() {
if (injectorState.shared) {
- injectorState.sharedError = Error("sharedInjector() cannot be called inside a context that has already called sharedInjector()");
+ injectorState.sharedError = Error('sharedInjector() cannot be called inside a context that has already called sharedInjector()');
throw injectorState.sharedError;
}
initialized = true;
@@ -2908,7 +2908,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
if (injectorState.shared && currentSpec && currentSpec !== this) {
var state = currentSpec;
currentSpec = this;
- angular.forEach(["$injector","$modules","$providerInjector", "$injectorStrict"], function(k) {
+ angular.forEach(['$injector','$modules','$providerInjector', '$injectorStrict'], function(k) {
currentSpec[k] = state[k];
state[k] = null;
});
@@ -3098,7 +3098,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
if (strictDi) {
// If strictDi is enabled, annotate the providerInjector blocks
angular.forEach(modules, function(moduleFn) {
- if (typeof moduleFn === "function") {
+ if (typeof moduleFn === 'function') {
angular.injector.$$annotate(moduleFn);
}
});
diff --git a/src/ngMock/browserTrigger.js b/src/ngMock/browserTrigger.js
index 036d8d636106..e2483204d467 100644
--- a/src/ngMock/browserTrigger.js
+++ b/src/ngMock/browserTrigger.js
@@ -198,7 +198,7 @@
function patchEventTargetForBubbling(event, target) {
event._target = target;
- Object.defineProperty(event, "target", {get: function() { return this._target;}});
+ Object.defineProperty(event, 'target', {get: function() { return this._target;}});
}
function isAttachedToDocument(element) {
diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js
index 032e66f65564..c20207a44143 100644
--- a/src/ngResource/resource.js
+++ b/src/ngResource/resource.js
@@ -542,12 +542,12 @@ angular.module('ngResource', ['ng']).
var urlParams = self.urlParams = Object.create(null);
forEach(url.split(/\W/), function(param) {
if (param === 'hasOwnProperty') {
- throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
+ throw $resourceMinErr('badname', 'hasOwnProperty is not a valid parameter name.');
}
- if (!(new RegExp("^\\d+$").test(param)) && param &&
- (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
+ if (!(new RegExp('^\\d+$').test(param)) && param &&
+ (new RegExp('(^|[^\\\\]):' + param + '(\\W|$)').test(url))) {
urlParams[param] = {
- isQueryParamValue: (new RegExp("\\?.*=:" + param + "(?:\\W|$)")).test(url)
+ isQueryParamValue: (new RegExp('\\?.*=:' + param + '(?:\\W|$)')).test(url)
};
}
});
@@ -566,11 +566,11 @@ angular.module('ngResource', ['ng']).
} else {
encodedVal = encodeUriSegment(val);
}
- url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
+ url = url.replace(new RegExp(':' + urlParam + '(\\W|$)', 'g'), function(match, p1) {
return encodedVal + p1;
});
} else {
- url = url.replace(new RegExp("(/?):" + urlParam + "(\\W|$)", "g"), function(match,
+ url = url.replace(new RegExp('(/?):' + urlParam + '(\\W|$)', 'g'), function(match,
leadingSlashes, tail) {
if (tail.charAt(0) === '/') {
return tail;
@@ -687,7 +687,7 @@ angular.module('ngResource', ['ng']).
case 0: break;
default:
throw $resourceMinErr('badargs',
- "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
+ 'Expected up to 4 arguments [params, data, success, error], got {0} arguments',
arguments.length);
}
@@ -744,7 +744,7 @@ angular.module('ngResource', ['ng']).
if (action.isArray) {
value.length = 0;
forEach(data, function(item) {
- if (typeof item === "object") {
+ if (typeof item === 'object') {
value.push(new Resource(item));
} else {
// Valid JSON values may be string literals, and these should not be converted
diff --git a/src/ngRoute/directive/ngView.js b/src/ngRoute/directive/ngView.js
index 8cff45618261..dba842f1eafa 100644
--- a/src/ngRoute/directive/ngView.js
+++ b/src/ngRoute/directive/ngView.js
@@ -149,11 +149,11 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
this.$routeParams = $routeParams;
}])
.controller('BookCtrl', ['$routeParams', function BookCtrl($routeParams) {
- this.name = "BookCtrl";
+ this.name = 'BookCtrl';
this.params = $routeParams;
}])
.controller('ChapterCtrl', ['$routeParams', function ChapterCtrl($routeParams) {
- this.name = "ChapterCtrl";
+ this.name = 'ChapterCtrl';
this.params = $routeParams;
}]);
diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js
index 1c289e600117..551781da9346 100644
--- a/src/ngRoute/route.js
+++ b/src/ngRoute/route.js
@@ -431,12 +431,12 @@ function $RouteProvider() {
* })
*
* .controller('BookController', function($scope, $routeParams) {
- * $scope.name = "BookController";
+ * $scope.name = 'BookController';
* $scope.params = $routeParams;
* })
*
* .controller('ChapterController', function($scope, $routeParams) {
- * $scope.name = "ChapterController";
+ * $scope.name = 'ChapterController';
* $scope.params = $routeParams;
* })
*
diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js
index 64759e9c017a..a816069bcf48 100644
--- a/src/ngSanitize/sanitize.js
+++ b/src/ngSanitize/sanitize.js
@@ -230,36 +230,36 @@ function $SanitizeProvider() {
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
- var voidElements = toMap("area,br,col,hr,img,wbr");
+ var voidElements = toMap('area,br,col,hr,img,wbr');
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
- var optionalEndTagBlockElements = toMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
- optionalEndTagInlineElements = toMap("rp,rt"),
+ var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'),
+ optionalEndTagInlineElements = toMap('rp,rt'),
optionalEndTagElements = extend({},
optionalEndTagInlineElements,
optionalEndTagBlockElements);
// Safe Block Elements - HTML5
- var blockElements = extend({}, optionalEndTagBlockElements, toMap("address,article," +
- "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
- "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul"));
+ var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' +
+ 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +
+ 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul'));
// Inline Elements - HTML5
- var inlineElements = extend({}, optionalEndTagInlineElements, toMap("a,abbr,acronym,b," +
- "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
- "samp,small,span,strike,strong,sub,sup,time,tt,u,var"));
+ var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' +
+ 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' +
+ 'samp,small,span,strike,strong,sub,sup,time,tt,u,var'));
// SVG Elements
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements
// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.
// They can potentially allow for arbitrary javascript to be executed. See #11290
- var svgElements = toMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph," +
- "hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline," +
- "radialGradient,rect,stop,svg,switch,text,title,tspan");
+ var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' +
+ 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' +
+ 'radialGradient,rect,stop,svg,switch,text,title,tspan');
// Blocked Elements (will be stripped)
- var blockedElements = toMap("script,style");
+ var blockedElements = toMap('script,style');
var validElements = extend({},
voidElements,
@@ -268,7 +268,7 @@ function $SanitizeProvider() {
optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
- var uriAttrs = toMap("background,cite,href,longdesc,src,xlink:href");
+ var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href');
var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
@@ -311,9 +311,9 @@ function $SanitizeProvider() {
(function(window) {
var doc;
if (window.document && window.document.implementation) {
- doc = window.document.implementation.createHTMLDocument("inert");
+ doc = window.document.implementation.createHTMLDocument('inert');
} else {
- throw $sanitizeMinErr('noinert', "Can't create an inert html document");
+ throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document');
}
var docElement = doc.documentElement || doc.getDocumentElement();
var bodyElements = docElement.getElementsByTagName('body');
@@ -353,7 +353,7 @@ function $SanitizeProvider() {
var mXSSAttempts = 5;
do {
if (mXSSAttempts === 0) {
- throw $sanitizeMinErr('uinput', "Failed to sanitize html because the input is unstable");
+ throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
}
mXSSAttempts--;
diff --git a/src/ngScenario/Application.js b/src/ngScenario/Application.js
index 07efe4fa2baa..3639a3274506 100644
--- a/src/ngScenario/Application.js
+++ b/src/ngScenario/Application.js
@@ -97,7 +97,7 @@ angular.scenario.Application.prototype.navigateTo = function(url, loadFn, errorF
}).attr('src', url);
// for IE compatibility set the name *after* setting the frame url
- frame[0].contentWindow.name = "NG_DEFER_BOOTSTRAP!";
+ frame[0].contentWindow.name = 'NG_DEFER_BOOTSTRAP!';
}
self.context.find('> h2 a').attr('href', url).text(url);
};
diff --git a/src/ngScenario/angular-bootstrap.js b/src/ngScenario/angular-bootstrap.js
index 3f1b0bf7bee5..fae98227f1a5 100644
--- a/src/ngScenario/angular-bootstrap.js
+++ b/src/ngScenario/angular-bootstrap.js
@@ -3,7 +3,7 @@
(function(previousOnLoad) {
var prefix = (function() {
var filename = /(.*\/)angular-bootstrap.js(#(.*))?/;
- var scripts = window.document.getElementsByTagName("script");
+ var scripts = window.document.getElementsByTagName('script');
for (var j = 0; j < scripts.length; j++) {
var src = scripts[j].src;
if (src && src.match(filename)) {
@@ -28,28 +28,28 @@
angular.scenario.setUpAndRun({});
};
- addCSS("../../css/angular-scenario.css");
- addScript("../../lib/jquery/jquery.js");
+ addCSS('../../css/angular-scenario.css');
+ addScript('../../lib/jquery/jquery.js');
window.document.write(
''
);
- addScript("../angular-bootstrap.js");
-
- addScript("Scenario.js");
- addScript("Application.js");
- addScript("Describe.js");
- addScript("Future.js");
- addScript("Runner.js");
- addScript("SpecRunner.js");
- addScript("dsl.js");
- addScript("matchers.js");
- addScript("ObjectModel.js");
- addScript("output/Html.js");
- addScript("output/Json.js");
- addScript("output/Object.js");
- addScript("output/Xml.js");
+ addScript('../angular-bootstrap.js');
+
+ addScript('Scenario.js');
+ addScript('Application.js');
+ addScript('Describe.js');
+ addScript('Future.js');
+ addScript('Runner.js');
+ addScript('SpecRunner.js');
+ addScript('dsl.js');
+ addScript('matchers.js');
+ addScript('ObjectModel.js');
+ addScript('output/Html.js');
+ addScript('output/Json.js');
+ addScript('output/Object.js');
+ addScript('output/Xml.js');
// Create the runner (which also sets up the global API)
window.document.write(
diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js
index 625c2b80c368..142811b043d1 100644
--- a/src/ngScenario/dsl.js
+++ b/src/ngScenario/dsl.js
@@ -50,7 +50,7 @@ angular.scenario.dsl('browser', function() {
chain.navigateTo = function(url, delegate) {
var application = this.application;
- return this.addFuture("browser navigate to '" + url + "'", function(done) {
+ return this.addFuture('browser navigate to \'' + url + '\'', function(done) {
if (delegate) {
url = delegate.call(this, url);
}
@@ -181,11 +181,11 @@ angular.scenario.dsl('using', function() {
*/
angular.scenario.dsl('binding', function() {
return function(name) {
- return this.addFutureAction("select binding '" + name + "'",
+ return this.addFutureAction('select binding \'' + name + '\'',
function($window, $document, done) {
var values = $document.elements().bindings($window.angular.element, name);
if (!values.length) {
- return done("Binding selector '" + name + "' did not match.");
+ return done('Binding selector \'' + name + '\' did not match.');
}
done(null, values[0]);
});
@@ -204,7 +204,7 @@ angular.scenario.dsl('input', function() {
var supportInputEvent = 'oninput' in window.document.createElement('div') && !msie;
chain.enter = function(value, event) {
- return this.addFutureAction("input '" + this.name + "' enter '" + value + "'",
+ return this.addFutureAction('input \'' + this.name + '\' enter \'' + value + '\'',
function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
input.val(value);
@@ -214,7 +214,7 @@ angular.scenario.dsl('input', function() {
};
chain.check = function() {
- return this.addFutureAction("checkbox '" + this.name + "' toggle",
+ return this.addFutureAction('checkbox \'' + this.name + '\' toggle',
function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':checkbox');
input.trigger('click');
@@ -223,7 +223,7 @@ angular.scenario.dsl('input', function() {
};
chain.select = function(value) {
- return this.addFutureAction("radio button '" + this.name + "' toggle '" + value + "'",
+ return this.addFutureAction('radio button \'' + this.name + '\' toggle \'' + value + '\'',
function($window, $document, done) {
var input = $document.
elements('[ng\\:model="$1"][value="$2"]', this.name, value).filter(':radio');
@@ -233,7 +233,7 @@ angular.scenario.dsl('input', function() {
};
chain.val = function() {
- return this.addFutureAction("return input val", function($window, $document, done) {
+ return this.addFutureAction('return input val', function($window, $document, done) {
var input = $document.elements('[ng\\:model="$1"]', this.name).filter(':input');
done(null,input.val());
});
@@ -257,7 +257,7 @@ angular.scenario.dsl('repeater', function() {
var chain = {};
chain.count = function() {
- return this.addFutureAction("repeater '" + this.label + "' count",
+ return this.addFutureAction('repeater \'' + this.label + '\' count',
function($window, $document, done) {
try {
done(null, $document.elements().length);
@@ -268,14 +268,14 @@ angular.scenario.dsl('repeater', function() {
};
chain.column = function(binding) {
- return this.addFutureAction("repeater '" + this.label + "' column '" + binding + "'",
+ return this.addFutureAction('repeater \'' + this.label + '\' column \'' + binding + '\'',
function($window, $document, done) {
done(null, $document.elements().bindings($window.angular.element, binding));
});
};
chain.row = function(index) {
- return this.addFutureAction("repeater '" + this.label + "' row '" + index + "'",
+ return this.addFutureAction('repeater \'' + this.label + '\' row \'' + index + '\'',
function($window, $document, done) {
var matches = $document.elements().slice(index, index + 1);
if (!matches.length) {
@@ -300,7 +300,7 @@ angular.scenario.dsl('select', function() {
var chain = {};
chain.option = function(value) {
- return this.addFutureAction("select '" + this.name + "' option '" + value + "'",
+ return this.addFutureAction('select \'' + this.name + '\' option \'' + value + '\'',
function($window, $document, done) {
var select = $document.elements('select[ng\\:model="$1"]', this.name);
var option = select.find('option[value="' + value + '"]');
@@ -316,7 +316,7 @@ angular.scenario.dsl('select', function() {
if (option.length) {
select.val(option.val());
} else {
- return done("option '" + value + "' not found");
+ return done('option \'' + value + '\' not found');
}
}
select.trigger('change');
@@ -326,7 +326,7 @@ angular.scenario.dsl('select', function() {
chain.options = function() {
var values = arguments;
- return this.addFutureAction("select '" + this.name + "' options '" + values + "'",
+ return this.addFutureAction('select \'' + this.name + '\' options \'' + values + '\'',
function($window, $document, done) {
var select = $document.elements('select[multiple][ng\\:model="$1"]', this.name);
select.val(values);
@@ -363,7 +363,7 @@ angular.scenario.dsl('element', function() {
var chain = {};
chain.count = function() {
- return this.addFutureAction("element '" + this.label + "' count",
+ return this.addFutureAction('element \'' + this.label + '\' count',
function($window, $document, done) {
try {
done(null, $document.elements().length);
@@ -374,7 +374,7 @@ angular.scenario.dsl('element', function() {
};
chain.click = function() {
- return this.addFutureAction("element '" + this.label + "' click",
+ return this.addFutureAction('element \'' + this.label + '\' click',
function($window, $document, done) {
var elements = $document.elements();
var href = elements.attr('href');
@@ -391,7 +391,7 @@ angular.scenario.dsl('element', function() {
};
chain.dblclick = function() {
- return this.addFutureAction("element '" + this.label + "' dblclick",
+ return this.addFutureAction('element \'' + this.label + '\' dblclick',
function($window, $document, done) {
var elements = $document.elements();
var href = elements.attr('href');
@@ -408,7 +408,7 @@ angular.scenario.dsl('element', function() {
};
chain.mouseover = function() {
- return this.addFutureAction("element '" + this.label + "' mouseover",
+ return this.addFutureAction('element \'' + this.label + '\' mouseover',
function($window, $document, done) {
var elements = $document.elements();
elements.trigger('mouseover');
@@ -417,7 +417,7 @@ angular.scenario.dsl('element', function() {
};
chain.mousedown = function() {
- return this.addFutureAction("element '" + this.label + "' mousedown",
+ return this.addFutureAction('element \'' + this.label + '\' mousedown',
function($window, $document, done) {
var elements = $document.elements();
elements.trigger('mousedown');
@@ -426,7 +426,7 @@ angular.scenario.dsl('element', function() {
};
chain.mouseup = function() {
- return this.addFutureAction("element '" + this.label + "' mouseup",
+ return this.addFutureAction('element \'' + this.label + '\' mouseup',
function($window, $document, done) {
var elements = $document.elements();
elements.trigger('mouseup');
@@ -445,9 +445,9 @@ angular.scenario.dsl('element', function() {
chain[methodName] = function(name, value) {
var args = arguments,
futureName = (args.length === 1)
- ? "element '" + this.label + "' get " + methodName + " '" + name + "'"
- : "element '" + this.label + "' set " + methodName + " '" + name + "' to '" +
- value + "'";
+ ? 'element \'' + this.label + '\' get ' + methodName + ' \'' + name + '\''
+ : 'element \'' + this.label + '\' set ' + methodName + ' \'' + name + '\' to \'' +
+ value + '\'';
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
@@ -460,8 +460,8 @@ angular.scenario.dsl('element', function() {
chain[methodName] = function(value) {
var args = arguments,
futureName = (args.length === 0)
- ? "element '" + this.label + "' " + methodName
- : "element '" + this.label + "' set " + methodName + " to '" + value + "'";
+ ? 'element \'' + this.label + '\' ' + methodName
+ : 'element \'' + this.label + '\' set ' + methodName + ' to \'' + value + '\'';
return this.addFutureAction(futureName, function($window, $document, done) {
var element = $document.elements();
diff --git a/src/ngScenario/output/Html.js b/src/ngScenario/output/Html.js
index 7f69a734db20..962d5a32303a 100644
--- a/src/ngScenario/output/Html.js
+++ b/src/ngScenario/output/Html.js
@@ -76,7 +76,7 @@ angular.scenario.output('html', function(context, runner, model) {
spec = model.getSpec(spec.id);
ui.removeClass('status-pending');
ui.addClass('status-' + spec.status);
- ui.find("> .test-info .timer-result").text(spec.duration + "ms");
+ ui.find('> .test-info .timer-result').text(spec.duration + 'ms');
if (spec.status === 'success') {
ui.find('> .test-info .test-name').addClass('closed');
ui.find('> .scrollpane .test-actions').hide();
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index d8b9bf5b9af2..6fa00567139a 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -25,15 +25,15 @@ describe('angular', function() {
});
});
- describe("copy", function() {
- it("should return same object", function() {
+ describe('copy', function() {
+ it('should return same object', function() {
var obj = {};
var arr = [];
expect(copy({}, obj)).toBe(obj);
expect(copy([], arr)).toBe(arr);
});
- it("should preserve prototype chaining", function() {
+ it('should preserve prototype chaining', function() {
var GrandParentProto = {};
var ParentProto = Object.create(GrandParentProto);
var obj = Object.create(ParentProto);
@@ -43,51 +43,51 @@ describe('angular', function() {
expect(copy(new Foo()) instanceof Foo).toBe(true);
});
- it("should copy Date", function() {
+ it('should copy Date', function() {
var date = new Date(123);
expect(copy(date) instanceof Date).toBeTruthy();
expect(copy(date).getTime()).toEqual(123);
expect(copy(date) === date).toBeFalsy();
});
- it("should copy RegExp", function() {
- var re = new RegExp(".*");
+ it('should copy RegExp', function() {
+ var re = new RegExp('.*');
expect(copy(re) instanceof RegExp).toBeTruthy();
- expect(copy(re).source).toBe(".*");
+ expect(copy(re).source).toBe('.*');
expect(copy(re) === re).toBe(false);
});
- it("should copy literal RegExp", function() {
+ it('should copy literal RegExp', function() {
var re = /.*/;
expect(copy(re) instanceof RegExp).toBeTruthy();
- expect(copy(re).source).toEqual(".*");
+ expect(copy(re).source).toEqual('.*');
expect(copy(re) === re).toBeFalsy();
});
- it("should copy RegExp with flags", function() {
+ it('should copy RegExp with flags', function() {
var re = new RegExp('.*', 'gim');
expect(copy(re).global).toBe(true);
expect(copy(re).ignoreCase).toBe(true);
expect(copy(re).multiline).toBe(true);
});
- it("should copy RegExp with lastIndex", function() {
+ it('should copy RegExp with lastIndex', function() {
var re = /a+b+/g;
var str = 'ab aabb';
expect(re.exec(str)[0]).toEqual('ab');
expect(copy(re).exec(str)[0]).toEqual('aabb');
});
- it("should deeply copy literal RegExp", function() {
+ it('should deeply copy literal RegExp', function() {
var objWithRegExp = {
re: /.*/
};
expect(copy(objWithRegExp).re instanceof RegExp).toBeTruthy();
- expect(copy(objWithRegExp).re.source).toEqual(".*");
+ expect(copy(objWithRegExp).re.source).toEqual('.*');
expect(copy(objWithRegExp.re) === objWithRegExp.re).toBeFalsy();
});
- it("should copy a Uint8Array with no destination", function() {
+ it('should copy a Uint8Array with no destination', function() {
if (typeof Uint8Array !== 'undefined') {
var src = new Uint8Array(2);
src[1] = 1;
@@ -99,7 +99,7 @@ describe('angular', function() {
}
});
- it("should copy a Uint8ClampedArray with no destination", function() {
+ it('should copy a Uint8ClampedArray with no destination', function() {
if (typeof Uint8ClampedArray !== 'undefined') {
var src = new Uint8ClampedArray(2);
src[1] = 1;
@@ -111,7 +111,7 @@ describe('angular', function() {
}
});
- it("should copy a Uint16Array with no destination", function() {
+ it('should copy a Uint16Array with no destination', function() {
if (typeof Uint16Array !== 'undefined') {
var src = new Uint16Array(2);
src[1] = 1;
@@ -123,7 +123,7 @@ describe('angular', function() {
}
});
- it("should copy a Uint32Array with no destination", function() {
+ it('should copy a Uint32Array with no destination', function() {
if (typeof Uint32Array !== 'undefined') {
var src = new Uint32Array(2);
src[1] = 1;
@@ -135,7 +135,7 @@ describe('angular', function() {
}
});
- it("should copy a Int8Array with no destination", function() {
+ it('should copy a Int8Array with no destination', function() {
if (typeof Int8Array !== 'undefined') {
var src = new Int8Array(2);
src[1] = 1;
@@ -147,7 +147,7 @@ describe('angular', function() {
}
});
- it("should copy a Int16Array with no destination", function() {
+ it('should copy a Int16Array with no destination', function() {
if (typeof Int16Array !== 'undefined') {
var src = new Int16Array(2);
src[1] = 1;
@@ -159,7 +159,7 @@ describe('angular', function() {
}
});
- it("should copy a Int32Array with no destination", function() {
+ it('should copy a Int32Array with no destination', function() {
if (typeof Int32Array !== 'undefined') {
var src = new Int32Array(2);
src[1] = 1;
@@ -171,7 +171,7 @@ describe('angular', function() {
}
});
- it("should copy a Float32Array with no destination", function() {
+ it('should copy a Float32Array with no destination', function() {
if (typeof Float32Array !== 'undefined') {
var src = new Float32Array(2);
src[1] = 1;
@@ -183,7 +183,7 @@ describe('angular', function() {
}
});
- it("should copy a Float64Array with no destination", function() {
+ it('should copy a Float64Array with no destination', function() {
if (typeof Float64Array !== 'undefined') {
var src = new Float64Array(2);
src[1] = 1;
@@ -249,7 +249,7 @@ describe('angular', function() {
}
});
- it("should handle Uint16Array subarray", function() {
+ it('should handle Uint16Array subarray', function() {
if (typeof Uint16Array !== 'undefined') {
var arr = new Uint16Array(4);
arr[1] = 1;
@@ -263,109 +263,109 @@ describe('angular', function() {
}
});
- it("should throw an exception if a Uint8Array is the destination", function() {
+ it('should throw an exception if a Uint8Array is the destination', function() {
if (typeof Uint8Array !== 'undefined') {
var src = new Uint8Array();
var dst = new Uint8Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Uint8ClampedArray is the destination", function() {
+ it('should throw an exception if a Uint8ClampedArray is the destination', function() {
if (typeof Uint8ClampedArray !== 'undefined') {
var src = new Uint8ClampedArray();
var dst = new Uint8ClampedArray(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Uint16Array is the destination", function() {
+ it('should throw an exception if a Uint16Array is the destination', function() {
if (typeof Uint16Array !== 'undefined') {
var src = new Uint16Array();
var dst = new Uint16Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Uint32Array is the destination", function() {
+ it('should throw an exception if a Uint32Array is the destination', function() {
if (typeof Uint32Array !== 'undefined') {
var src = new Uint32Array();
var dst = new Uint32Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Int8Array is the destination", function() {
+ it('should throw an exception if a Int8Array is the destination', function() {
if (typeof Int8Array !== 'undefined') {
var src = new Int8Array();
var dst = new Int8Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Int16Array is the destination", function() {
+ it('should throw an exception if a Int16Array is the destination', function() {
if (typeof Int16Array !== 'undefined') {
var src = new Int16Array();
var dst = new Int16Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Int32Array is the destination", function() {
+ it('should throw an exception if a Int32Array is the destination', function() {
if (typeof Int32Array !== 'undefined') {
var src = new Int32Array();
var dst = new Int32Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Float32Array is the destination", function() {
+ it('should throw an exception if a Float32Array is the destination', function() {
if (typeof Float32Array !== 'undefined') {
var src = new Float32Array();
var dst = new Float32Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if a Float64Array is the destination", function() {
+ it('should throw an exception if a Float64Array is the destination', function() {
if (typeof Float64Array !== 'undefined') {
var src = new Float64Array();
var dst = new Float64Array(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should throw an exception if an ArrayBuffer is the destination", function() {
+ it('should throw an exception if an ArrayBuffer is the destination', function() {
if (typeof ArrayBuffer !== 'undefined') {
var src = new ArrayBuffer(5);
var dst = new ArrayBuffer(5);
expect(function() { copy(src, dst); })
- .toThrowMinErr("ng", "cpta", "Can't copy! TypedArray destination cannot be mutated.");
+ .toThrowMinErr('ng', 'cpta', 'Can\'t copy! TypedArray destination cannot be mutated.');
}
});
- it("should deeply copy an array into an existing array", function() {
- var src = [1, {name:"value"}];
- var dst = [{key:"v"}];
+ it('should deeply copy an array into an existing array', function() {
+ var src = [1, {name:'value'}];
+ var dst = [{key:'v'}];
expect(copy(src, dst)).toBe(dst);
- expect(dst).toEqual([1, {name:"value"}]);
- expect(dst[1]).toEqual({name:"value"});
+ expect(dst).toEqual([1, {name:'value'}]);
+ expect(dst[1]).toEqual({name:'value'});
expect(dst[1]).not.toBe(src[1]);
});
- it("should deeply copy an array into a new array", function() {
- var src = [1, {name:"value"}];
+ it('should deeply copy an array into a new array', function() {
+ var src = [1, {name:'value'}];
var dst = copy(src);
- expect(src).toEqual([1, {name:"value"}]);
+ expect(src).toEqual([1, {name:'value'}]);
expect(dst).toEqual(src);
expect(dst).not.toBe(src);
expect(dst[1]).not.toBe(src[1]);
@@ -373,31 +373,31 @@ describe('angular', function() {
it('should copy empty array', function() {
var src = [];
- var dst = [{key: "v"}];
+ var dst = [{key: 'v'}];
expect(copy(src, dst)).toEqual([]);
expect(dst).toEqual([]);
});
- it("should deeply copy an object into an existing object", function() {
- var src = {a:{name:"value"}};
- var dst = {b:{key:"v"}};
+ it('should deeply copy an object into an existing object', function() {
+ var src = {a:{name:'value'}};
+ var dst = {b:{key:'v'}};
expect(copy(src, dst)).toBe(dst);
- expect(dst).toEqual({a:{name:"value"}});
+ expect(dst).toEqual({a:{name:'value'}});
expect(dst.a).toEqual(src.a);
expect(dst.a).not.toBe(src.a);
});
- it("should deeply copy an object into a non-existing object", function() {
- var src = {a:{name:"value"}};
+ it('should deeply copy an object into a non-existing object', function() {
+ var src = {a:{name:'value'}};
var dst = copy(src, undefined);
- expect(src).toEqual({a:{name:"value"}});
+ expect(src).toEqual({a:{name:'value'}});
expect(dst).toEqual(src);
expect(dst).not.toBe(src);
expect(dst.a).toEqual(src.a);
expect(dst.a).not.toBe(src.a);
});
- it("should copy primitives", function() {
+ it('should copy primitives', function() {
expect(copy(null)).toEqual(null);
expect(copy('')).toBe('');
expect(copy('lala')).toBe('lala');
@@ -407,28 +407,28 @@ describe('angular', function() {
it('should throw an exception if a Scope is being copied', inject(function($rootScope) {
expect(function() { copy($rootScope.$new()); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
expect(function() { copy({child: $rootScope.$new()}, {}); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
expect(function() { copy([$rootScope.$new()]); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
}));
it('should throw an exception if a Window is being copied', function() {
expect(function() { copy(window); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
expect(function() { copy({child: window}); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
expect(function() { copy([window], []); }).
- toThrowMinErr("ng", "cpws", "Can't copy! Making copies of Window or Scope instances is not supported.");
+ toThrowMinErr('ng', 'cpws', 'Can\'t copy! Making copies of Window or Scope instances is not supported.');
});
it('should throw an exception when source and destination are equivalent', function() {
var src, dst;
src = dst = {key: 'value'};
- expect(function() { copy(src, dst); }).toThrowMinErr("ng", "cpi", "Can't copy! Source and destination are identical.");
+ expect(function() { copy(src, dst); }).toThrowMinErr('ng', 'cpi', 'Can\'t copy! Source and destination are identical.');
src = dst = [2, 4];
- expect(function() { copy(src, dst); }).toThrowMinErr("ng", "cpi", "Can't copy! Source and destination are identical.");
+ expect(function() { copy(src, dst); }).toThrowMinErr('ng', 'cpi', 'Can\'t copy! Source and destination are identical.');
});
it('should not copy the private $$hashKey', function() {
@@ -604,7 +604,7 @@ describe('angular', function() {
});
});
- describe("extend", function() {
+ describe('extend', function() {
it('should not copy the private $$hashKey', function() {
var src,dst;
@@ -669,7 +669,7 @@ describe('angular', function() {
it('should copy elements by reference', function() {
var src = { element: document.createElement('div'),
- jqObject: jqLite("s1 s2
").find("span") };
+ jqObject: jqLite('s1 s2
').find('span') };
var dst = {};
extend(dst, src);
@@ -697,13 +697,13 @@ describe('angular', function() {
it('should replace primitives with objects', function() {
- var dst = { foo: "bloop" };
- var src = { foo: { bar: { baz: "bloop" }}};
+ var dst = { foo: 'bloop' };
+ var src = { foo: { bar: { baz: 'bloop' }}};
merge(dst, src);
expect(dst).toEqual({
foo: {
bar: {
- baz: "bloop"
+ baz: 'bloop'
}
}
});
@@ -712,12 +712,12 @@ describe('angular', function() {
it('should replace null values in destination with objects', function() {
var dst = { foo: null };
- var src = { foo: { bar: { baz: "bloop" }}};
+ var src = { foo: { bar: { baz: 'bloop' }}};
merge(dst, src);
expect(dst).toEqual({
foo: {
bar: {
- baz: "bloop"
+ baz: 'bloop'
}
}
});
@@ -1237,7 +1237,7 @@ describe('angular', function() {
});
it('should return true if passed an object', function() {
- expect(isArrayLike({0:"test", 1:"bob", 2:"tree", length:3})).toBe(true);
+ expect(isArrayLike({0:'test', 1:'bob', 2:'tree', length:3})).toBe(true);
});
it('should return true if passed arguments object', function() {
@@ -1316,21 +1316,21 @@ describe('angular', function() {
it('should handle JQLite and jQuery objects like arrays', function() {
- var jqObject = jqLite("s1 s2
").find("span"),
+ var jqObject = jqLite('s1 s2
').find('span'),
log = [];
forEach(jqObject, function(value, key) { log.push(key + ':' + value.innerHTML); });
expect(log).toEqual(['0:s1', '1:s2']);
log = [];
- jqObject = jqLite(" ");
+ jqObject = jqLite(' ');
forEach(jqObject.children(), function(value, key) { log.push(key + ':' + value.innerHTML); });
expect(log).toEqual([]);
});
it('should handle NodeList objects like arrays', function() {
- var nodeList = jqLite("a b c
")[0].childNodes,
+ var nodeList = jqLite('a b c
')[0].childNodes,
log = [];
@@ -1340,11 +1340,11 @@ describe('angular', function() {
it('should handle HTMLCollection objects like arrays', function() {
- document.body.innerHTML = "" +
- "a " +
- "b " +
- "c " +
- "
";
+ document.body.innerHTML = '' +
+ 'a ' +
+ 'b ' +
+ 'c ' +
+ '
';
var htmlCollection = document.getElementsByName('x'),
log = [];
@@ -1478,22 +1478,22 @@ describe('angular', function() {
it('should follow the ES spec when called with jQuery/jqLite', function() {
- testForEachSpec(2, jqLite("a b "));
+ testForEachSpec(2, jqLite('a b '));
});
it('should follow the ES spec when called with childNodes NodeList', function() {
- testForEachSpec(2, jqLite("a b
")[0].childNodes);
+ testForEachSpec(2, jqLite('a b
')[0].childNodes);
});
it('should follow the ES spec when called with getElementsByTagName HTMLCollection', function() {
- testForEachSpec(2, jqLite("a b
")[0].getElementsByTagName("*"));
+ testForEachSpec(2, jqLite('a b
')[0].getElementsByTagName('*'));
});
it('should follow the ES spec when called with querySelectorAll HTMLCollection', function() {
- testForEachSpec(2, jqLite("a b
")[0].querySelectorAll("*"));
+ testForEachSpec(2, jqLite('a b
')[0].querySelectorAll('*'));
});
@@ -1520,8 +1520,8 @@ describe('angular', function() {
toEqual('asdf1234asdf');
//don't encode unreserved'
- expect(encodeUriSegment("-_.!~*'(); -_.!~*'();")).
- toEqual("-_.!~*'();%20-_.!~*'();");
+ expect(encodeUriSegment('-_.!~*\'(); -_.!~*\'();')).
+ toEqual('-_.!~*\'();%20-_.!~*\'();');
//don't encode the rest of pchar'
expect(encodeUriSegment(':@&=+$, :@&=+$,')).
@@ -1542,8 +1542,8 @@ describe('angular', function() {
toEqual('asdf1234asdf');
//don't encode unreserved
- expect(encodeUriQuery("-_.!~*'() -_.!~*'()")).
- toEqual("-_.!~*'()+-_.!~*'()");
+ expect(encodeUriQuery('-_.!~*\'() -_.!~*\'()')).
+ toEqual('-_.!~*\'()+-_.!~*\'()');
//don't encode the rest of pchar
expect(encodeUriQuery(':@$, :@$,')).
@@ -1842,9 +1842,9 @@ describe('angular', function() {
it('version should have full/major/minor/dot/codeName properties', function() {
expect(version).toBeDefined();
expect(version.full).toBe('"NG_VERSION_FULL"');
- expect(version.major).toBe("NG_VERSION_MAJOR");
- expect(version.minor).toBe("NG_VERSION_MINOR");
- expect(version.dot).toBe("NG_VERSION_DOT");
+ expect(version.major).toBe('NG_VERSION_MAJOR');
+ expect(version.minor).toBe('NG_VERSION_MINOR');
+ expect(version.dot).toBe('NG_VERSION_DOT');
expect(version.codeName).toBe('"NG_VERSION_CODENAME"');
});
});
@@ -1858,7 +1858,7 @@ describe('angular', function() {
dealoc(element);
});
- it("should complain if app module can't be found", function() {
+ it('should complain if app module can\'t be found', function() {
var element = jqLite('{{1+2}}
');
expect(function() {
@@ -1903,7 +1903,7 @@ describe('angular', function() {
window.name = 'NG_DEFER_BOOTSTRAP!';
angular.resumeDeferredBootstrap = noop;
- var spy = spyOn(angular, "resumeDeferredBootstrap");
+ var spy = spyOn(angular, 'resumeDeferredBootstrap');
injector = angular.bootstrap(element);
expect(spy).toHaveBeenCalled();
});
@@ -2065,7 +2065,7 @@ describe('angular', function() {
var element = $compile('Hello, world!
')($rootScope),
body = $document.find('body')[0],
expected = [false, false, false, false, false, false, false, true, true],
- tests = [null, undefined, "string", 1001, {}, 0, false, body, element];
+ tests = [null, undefined, 'string', 1001, {}, 0, false, body, element];
angular.forEach(tests, function(value, idx) {
var result = angular.isElement(value);
expect(typeof result).toEqual('boolean');
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index faeb9a9f25c7..5d9beae964cc 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -62,7 +62,7 @@ describe('Binder', function() {
}));
it('InputTypeButtonActionExecutesInScope2', inject(function($rootScope, $compile) {
- var log = "";
+ var log = '';
element = $compile(' ')($rootScope);
$rootScope.action = function() {
log += 'click;';
@@ -359,11 +359,11 @@ describe('Binder', function() {
it('ShoulIgnoreVbNonBindable', inject(function($rootScope, $compile) {
element = $compile(
- "{{a}}" +
- "
{{a}}
" +
- "
{{b}}
" +
- "
{{c}}
" +
- "
")($rootScope);
+ '{{a}}' +
+ '
{{a}}
' +
+ '
{{b}}
' +
+ '
{{c}}
' +
+ '
')($rootScope);
$rootScope.a = 123;
$rootScope.$apply();
expect(element.text()).toBe('123{{a}}{{b}}{{c}}');
@@ -371,7 +371,7 @@ describe('Binder', function() {
it('ShouldTemplateBindPreElements', inject(function($rootScope, $compile) {
element = $compile('Hello {{name}}! ')($rootScope);
- $rootScope.name = "World";
+ $rootScope.name = 'World';
$rootScope.$apply();
expect(sortedHtml(element)).toBe('Hello World! ');
diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js
index c0760aecb687..2e93498bb819 100644
--- a/test/auto/injectorSpec.js
+++ b/test/auto/injectorSpec.js
@@ -20,7 +20,7 @@ describe('injector', function() {
}));
- it("should return same instance from calling provider", function() {
+ it('should return same instance from calling provider', function() {
var instance = {},
original = instance;
providers('instance', function() { return instance; });
@@ -80,14 +80,14 @@ describe('injector', function() {
it('should provide useful message if no provider', function() {
expect(function() {
injector.get('idontexist');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist');
});
it('should provide the caller name if given', function() {
expect(function() {
injector.get('idontexist', 'callerName');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist <- callerName");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist <- callerName');
});
@@ -96,18 +96,18 @@ describe('injector', function() {
var $controller = injector.get('$controller');
expect(function() {
$controller('myCtrl', {$scope: {}});
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist <- myCtrl");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist <- myCtrl');
});
it('should not corrupt the cache when an object fails to get instantiated', function() {
expect(function() {
injector.get('idontexist');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist');
expect(function() {
injector.get('idontexist');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist');
});
@@ -116,7 +116,7 @@ describe('injector', function() {
providers('b', function(a) {return 2;});
expect(function() {
injector.get('b');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist <- a <- b");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: idontexistProvider <- idontexist <- a <- b');
});
@@ -147,13 +147,13 @@ describe('injector', function() {
it('should call function', function() {
Fn.$inject = ['a', 'b', 'c', 'd'];
- injector.invoke(Fn, {name:"this"}, {c:3, d:4});
+ injector.invoke(Fn, {name:'this'}, {c:3, d:4});
expect(args).toEqual([{name:'this'}, 1, 2, 3, 4]);
});
it('should treat array as annotations', function() {
- injector.invoke(['a', 'b', 'c', 'd', Fn], {name:"this"}, {c:3, d:4});
+ injector.invoke(['a', 'b', 'c', 'd', Fn], {name:'this'}, {c:3, d:4});
expect(args).toEqual([{name:'this'}, 1, 2, 3, 4]);
});
@@ -168,10 +168,10 @@ describe('injector', function() {
it('should fail with errors if not function or array', function() {
expect(function() {
injector.invoke({});
- }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got Object");
+ }).toThrowMinErr('ng', 'areq', 'Argument \'fn\' is not a function, got Object');
expect(function() {
injector.invoke(['a', 123], {});
- }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got number");
+ }).toThrowMinErr('ng', 'areq', 'Argument \'fn\' is not a function, got number');
});
});
@@ -947,7 +947,7 @@ describe('injector', function() {
it('should throw usefull error on wrong argument type]', function() {
expect(function() {
$injector.invoke({});
- }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got Object");
+ }).toThrowMinErr('ng', 'areq', 'Argument \'fn\' is not a function, got Object');
});
});
@@ -1044,7 +1044,7 @@ describe('injector', function() {
}]);
expect(function() {
$injector.get('nameProvider');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: nameProviderProvider <- nameProvider");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: nameProviderProvider <- nameProvider');
});
@@ -1052,7 +1052,7 @@ describe('injector', function() {
var $injector = createInjector([]);
expect(function() {
$injector.get('$provide').value('a', 'b');
- }).toThrowMinErr("$injector", "unpr", "Unknown provider: $provideProvider <- $provide");
+ }).toThrowMinErr('$injector', 'unpr', 'Unknown provider: $provideProvider <- $provide');
});
diff --git a/test/helpers/matchers.js b/test/helpers/matchers.js
index ec8cc436acb6..d68233e47db9 100644
--- a/test/helpers/matchers.js
+++ b/test/helpers/matchers.js
@@ -19,9 +19,9 @@ beforeEach(function() {
});
var message = function() {
- return "Expected to have " + presentClasses +
- (absentClasses ? (" and not have " + absentClasses + "") : "") +
- " but had " + element[0].className + ".";
+ return 'Expected to have ' + presentClasses +
+ (absentClasses ? (' and not have ' + absentClasses + '') : '') +
+ ' but had ' + element[0].className + '.';
};
return {
pass: present && !absent,
@@ -60,7 +60,7 @@ beforeEach(function() {
function generateCompare(isNot) {
return function(actual) {
var message = valueFn(
- "Expected object " + (isNot ? "not " : "") + "to be a promise");
+ 'Expected object ' + (isNot ? 'not ' : '') + 'to be a promise');
return { pass: isPromiseLike(actual), message: message };
};
}
@@ -72,7 +72,7 @@ beforeEach(function() {
};
function generateCompare(isNot) {
return function(actual) {
- var message = valueFn("Expected element " + (isNot ? "" : "not ") + "to have 'ng-hide' class");
+ var message = valueFn('Expected element ' + (isNot ? '' : 'not ') + 'to have \'ng-hide\' class');
var pass = !isNgElementHidden(actual);
if (isNot) {
pass = !pass;
@@ -88,7 +88,7 @@ beforeEach(function() {
};
function generateCompare(isNot) {
return function(actual) {
- var message = valueFn("Expected element " + (isNot ? "not " : "") + "to have 'ng-hide' class");
+ var message = valueFn('Expected element ' + (isNot ? 'not ' : '') + 'to have \'ng-hide\' class');
var pass = isNgElementHidden(actual);
if (isNot) {
pass = !pass;
@@ -235,13 +235,13 @@ beforeEach(function() {
};
function hasClass(element, selector) {
if (!element.getAttribute) return false;
- return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
- indexOf(" " + selector + " ") > -1);
+ return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\n\t]/g, ' ').
+ indexOf(' ' + selector + ' ') > -1);
}
function generateCompare(isNot) {
return function(actual, clazz) {
var message = function() {
- return "Expected '" + angular.mock.dump(actual) + "'" + (isNot ? " not " : "") + " to have class '" + clazz + "'.";
+ return 'Expected \'' + angular.mock.dump(actual) + '\'' + (isNot ? ' not ' : '') + ' to have class \'' + clazz + '\'.';
};
var classes = clazz.trim().split(/\s+/);
for (var i = 0; i < classes.length; ++i) {
@@ -268,11 +268,11 @@ beforeEach(function() {
// This function escapes all special regex characters.
// We use it to create matching regex from arbitrary strings.
// http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
},
codeRegex = new RegExp('^\\[' + escapeRegexp(namespace) + ':' + escapeRegexp(code) + '\\]'),
- not = isNot ? "not " : "",
- regex = jasmine.isA_("RegExp", content) ? content :
+ not = isNot ? 'not ' : '',
+ regex = jasmine.isA_('RegExp', content) ? content :
angular.isDefined(content) ? new RegExp(escapeRegexp(content)) : undefined;
if (!angular.isFunction(actual)) {
@@ -290,10 +290,10 @@ beforeEach(function() {
}
var message = function() {
- return "Expected function " + not + "to throw " +
- namespace + "MinErr('" + code + "')" +
- (regex ? " matching " + regex.toString() : "") +
- (exception ? ", but it threw " + exceptionMessage : ".");
+ return 'Expected function ' + not + 'to throw ' +
+ namespace + 'MinErr(\'' + code + '\')' +
+ (regex ? ' matching ' + regex.toString() : '') +
+ (exception ? ', but it threw ' + exceptionMessage : '.');
};
result = codeRegex.test(exceptionMessage);
diff --git a/test/helpers/testabilityPatch.js b/test/helpers/testabilityPatch.js
index 669c304d861c..dfb03b31e739 100644
--- a/test/helpers/testabilityPatch.js
+++ b/test/helpers/testabilityPatch.js
@@ -156,15 +156,15 @@ function jqLiteCacheSize() {
* @param {boolean=} showNgClass
*/
function sortedHtml(element, showNgClass) {
- var html = "";
+ var html = '';
forEach(jqLite(element), function toString(node) {
- if (node.nodeName === "#text") {
+ if (node.nodeName === '#text') {
html += node.nodeValue.
replace(/&(\w+[&;\W])?/g, function(match, entity) {return entity ? match : '&';}).
replace(//g, '>');
- } else if (node.nodeName === "#comment") {
+ } else if (node.nodeName === '#comment') {
html += '';
} else {
html += '<' + (node.nodeName || '?NOT_A_NODE?').toLowerCase();
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 48835bb000c9..87ad0566a08f 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -20,7 +20,7 @@ describe('jqLite', function() {
toJqEqual: function() {
return {
compare: function(_actual_, expected) {
- var msg = "Unequal length";
+ var msg = 'Unequal length';
var message = function() {return msg;};
var value = _actual_ && expected && _actual_.length === expected.length;
@@ -28,9 +28,9 @@ describe('jqLite', function() {
var actual = jqLite(_actual_[i])[0];
var expect = jqLite(expected[i])[0];
value = value && equals(expect, actual);
- msg = "Not equal at index: " + i
- + " - Expected: " + expect
- + " - Actual: " + actual;
+ msg = 'Not equal at index: ' + i
+ + ' - Expected: ' + expect
+ + ' - Actual: ' + actual;
}
return { pass: value, message: message };
}
@@ -230,9 +230,9 @@ describe('jqLite', function() {
frag = document.createDocumentFragment(),
$frag = jqLite(frag);
frag.host = host[0];
- host.data("foo", 123);
+ host.data('foo', 123);
host.append($frag);
- expect($frag.inheritedData("foo")).toBe(123);
+ expect($frag.inheritedData('foo')).toBe(123);
dealoc(host);
dealoc($frag);
@@ -438,24 +438,24 @@ describe('jqLite', function() {
var node = document.createElement('div');
expect(jqLite.hasData(node)).toBe(false);
- expect(jqLite.data(node, "foo")).toBeUndefined();
+ expect(jqLite.data(node, 'foo')).toBeUndefined();
expect(jqLite.hasData(node)).toBe(false);
- jqLite.data(node, "foo", "bar");
+ jqLite.data(node, 'foo', 'bar');
expect(jqLite.hasData(node)).toBe(true);
- expect(jqLite.data(node, "foo")).toBe("bar");
- expect(jqLite(node).data("foo")).toBe("bar");
+ expect(jqLite.data(node, 'foo')).toBe('bar');
+ expect(jqLite(node).data('foo')).toBe('bar');
expect(jqLite.data(node)).toBe(jqLite(node).data());
- jqLite.removeData(node, "foo");
- expect(jqLite.data(node, "foo")).toBeUndefined();
+ jqLite.removeData(node, 'foo');
+ expect(jqLite.data(node, 'foo')).toBeUndefined();
- jqLite.data(node, "bar", "baz");
+ jqLite.data(node, 'bar', 'baz');
jqLite.removeData(node);
jqLite.removeData(node);
- expect(jqLite.data(node, "bar")).toBeUndefined();
+ expect(jqLite.data(node, 'bar')).toBeUndefined();
jqLite(node).remove();
expect(jqLite.hasData(node)).toBe(false);
@@ -1857,7 +1857,7 @@ describe('jqLite', function() {
it('should wrap text node', function() {
var root = jqLite('A<a>B</a>C
');
var text = root.contents();
- expect(text.wrap("")[0]).toBe(text[0]);
+ expect(text.wrap('')[0]).toBe(text[0]);
expect(root.find('span').text()).toEqual('AB C');
});
it('should wrap free text node', function() {
@@ -1866,7 +1866,7 @@ describe('jqLite', function() {
text.remove();
expect(root.text()).toBe('');
- text.wrap("");
+ text.wrap('');
expect(text.parent().text()).toEqual('AB C');
});
it('should clone elements to be wrapped around target', function() {
@@ -2084,9 +2084,9 @@ describe('jqLite', function() {
element.on('click', pokeSpy);
- element.triggerHandler('click', [{hello: "world"}]);
+ element.triggerHandler('click', [{hello: 'world'}]);
data = pokeSpy.calls.mostRecent().args[1];
- expect(data.hello).toBe("world");
+ expect(data.hello).toBe('world');
});
it('should mark event as prevented if preventDefault is called', function() {
@@ -2122,7 +2122,7 @@ describe('jqLite', function() {
expect(clickSpy).toHaveBeenCalledTimes(2);
});
- it("should accept a custom event instead of eventName", function() {
+ it('should accept a custom event instead of eventName', function() {
var element = jqLite('poke '),
pokeSpy = jasmine.createSpy('poke'),
customEvent = {
diff --git a/test/loaderSpec.js b/test/loaderSpec.js
index 26d676452b26..c4f7a33989bd 100644
--- a/test/loaderSpec.js
+++ b/test/loaderSpec.js
@@ -66,7 +66,7 @@ describe('module loader', function() {
});
- it("should not throw error when `module.decorator` is declared before provider that it decorates", function() {
+ it('should not throw error when `module.decorator` is declared before provider that it decorates', function() {
angular.module('theModule', []).
decorator('theProvider', function($delegate) { return $delegate; }).
factory('theProvider', function() { return {}; });
@@ -77,7 +77,7 @@ describe('module loader', function() {
});
- it("should run decorators in order of declaration, even when mixed with provider.decorator", function() {
+ it('should run decorators in order of declaration, even when mixed with provider.decorator', function() {
var log = '';
angular.module('theModule', [])
@@ -107,7 +107,7 @@ describe('module loader', function() {
});
- it("should decorate the last declared provider if multiple have been declared", function() {
+ it('should decorate the last declared provider if multiple have been declared', function() {
var log = '';
angular.module('theModule', []).
@@ -142,15 +142,15 @@ describe('module loader', function() {
it('should complain of no module', function() {
expect(function() {
window.angular.module('dontExist');
- }).toThrowMinErr("$injector", "nomod", "Module 'dontExist' is not available! You either misspelled the module name " +
- "or forgot to load it. If registering a module ensure that you specify the dependencies as the second " +
- "argument.");
+ }).toThrowMinErr('$injector', 'nomod', 'Module \'dontExist\' is not available! You either misspelled the module name ' +
+ 'or forgot to load it. If registering a module ensure that you specify the dependencies as the second ' +
+ 'argument.');
});
it('should complain if a module is called "hasOwnProperty', function() {
expect(function() {
window.angular.module('hasOwnProperty', []);
- }).toThrowMinErr('ng','badname', "hasOwnProperty is not a valid module name");
+ }).toThrowMinErr('ng','badname', 'hasOwnProperty is not a valid module name');
});
it('should expose `$$minErr` on the `angular` object', function() {
diff --git a/test/minErrSpec.js b/test/minErrSpec.js
index abf036883eba..d438dc517b58 100644
--- a/test/minErrSpec.js
+++ b/test/minErrSpec.js
@@ -19,7 +19,7 @@ describe('minErr', function() {
function someFn() {
function nestedFn() {
- myError = testError('fail', "I fail!");
+ myError = testError('fail', 'I fail!');
}
nestedFn();
}
diff --git a/test/modules/no_bootstrap.js b/test/modules/no_bootstrap.js
index b44324c59dfb..d39f8a5b1d76 100644
--- a/test/modules/no_bootstrap.js
+++ b/test/modules/no_bootstrap.js
@@ -1,4 +1,4 @@
'use strict';
// When running the modules test, then the page should not be bootstrapped.
-window.name = "NG_DEFER_BOOTSTRAP!";
+window.name = 'NG_DEFER_BOOTSTRAP!';
diff --git a/test/ng/animateCssSpec.js b/test/ng/animateCssSpec.js
index dcc37b7fc9c9..5299cfa0a4fc 100644
--- a/test/ng/animateCssSpec.js
+++ b/test/ng/animateCssSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("$animateCss", function() {
+describe('$animateCss', function() {
var triggerRAF, element;
beforeEach(inject(function($$rAF, $rootElement, $document) {
@@ -14,9 +14,9 @@ describe("$animateCss", function() {
body.append($rootElement);
}));
- describe("without animation", function() {
+ describe('without animation', function() {
- it("should not alter the provided options input in any way", inject(function($animateCss) {
+ it('should not alter the provided options input in any way', inject(function($animateCss) {
var initialOptions = {
from: { height: '50px' },
to: { width: '50px' },
@@ -31,7 +31,7 @@ describe("$animateCss", function() {
expect(copiedOptions).toEqual(initialOptions);
}));
- it("should not create a copy of the provided options if they have already been prepared earlier",
+ it('should not create a copy of the provided options if they have already been prepared earlier',
inject(function($animateCss, $$rAF) {
var options = {
@@ -53,26 +53,26 @@ describe("$animateCss", function() {
expect(options.from).toBeFalsy();
}));
- it("should apply the provided [from] CSS to the element", inject(function($animateCss) {
+ it('should apply the provided [from] CSS to the element', inject(function($animateCss) {
$animateCss(element, { from: { height: '50px' }}).start();
expect(element.css('height')).toBe('50px');
}));
- it("should apply the provided [to] CSS to the element after the first frame", inject(function($animateCss) {
+ it('should apply the provided [to] CSS to the element after the first frame', inject(function($animateCss) {
$animateCss(element, { to: { width: '50px' }}).start();
expect(element.css('width')).not.toBe('50px');
triggerRAF();
expect(element.css('width')).toBe('50px');
}));
- it("should apply the provided [addClass] CSS classes to the element after the first frame", inject(function($animateCss) {
+ it('should apply the provided [addClass] CSS classes to the element after the first frame', inject(function($animateCss) {
$animateCss(element, { addClass: 'golden man' }).start();
expect(element).not.toHaveClass('golden man');
triggerRAF();
expect(element).toHaveClass('golden man');
}));
- it("should apply the provided [removeClass] CSS classes to the element after the first frame", inject(function($animateCss) {
+ it('should apply the provided [removeClass] CSS classes to the element after the first frame', inject(function($animateCss) {
element.addClass('silver');
$animateCss(element, { removeClass: 'silver dude' }).start();
expect(element).toHaveClass('silver');
@@ -80,17 +80,17 @@ describe("$animateCss", function() {
expect(element).not.toHaveClass('silver');
}));
- it("should return an animator with a start method which returns a promise", inject(function($animateCss) {
+ it('should return an animator with a start method which returns a promise', inject(function($animateCss) {
var promise = $animateCss(element, { addClass: 'cool' }).start();
expect(isPromiseLike(promise)).toBe(true);
}));
- it("should return an animator with an end method which returns a promise", inject(function($animateCss) {
+ it('should return an animator with an end method which returns a promise', inject(function($animateCss) {
var promise = $animateCss(element, { addClass: 'cool' }).end();
expect(isPromiseLike(promise)).toBe(true);
}));
- it("should only resolve the promise once both a digest and RAF have passed after start",
+ it('should only resolve the promise once both a digest and RAF have passed after start',
inject(function($animateCss, $rootScope) {
var doneSpy = jasmine.createSpy();
@@ -106,7 +106,7 @@ describe("$animateCss", function() {
expect(doneSpy).toHaveBeenCalled();
}));
- it("should resolve immediately if runner.end() is called",
+ it('should resolve immediately if runner.end() is called',
inject(function($animateCss, $rootScope) {
var doneSpy = jasmine.createSpy();
@@ -120,7 +120,7 @@ describe("$animateCss", function() {
expect(doneSpy).toHaveBeenCalled();
}));
- it("should reject immediately if runner.end() is called",
+ it('should reject immediately if runner.end() is called',
inject(function($animateCss, $rootScope) {
var cancelSpy = jasmine.createSpy();
@@ -134,7 +134,7 @@ describe("$animateCss", function() {
expect(cancelSpy).toHaveBeenCalled();
}));
- it("should not resolve after the next frame if the runner has already been cancelled",
+ it('should not resolve after the next frame if the runner has already been cancelled',
inject(function($animateCss, $rootScope) {
var doneSpy = jasmine.createSpy();
@@ -153,7 +153,7 @@ describe("$animateCss", function() {
expect(doneSpy).not.toHaveBeenCalled();
}));
- it("should not bother applying the provided [from] and [to] styles to the element if [cleanupStyles] is present",
+ it('should not bother applying the provided [from] and [to] styles to the element if [cleanupStyles] is present',
inject(function($animateCss, $rootScope) {
var animator = $animateCss(element, {
diff --git a/test/ng/animateRunnerSpec.js b/test/ng/animateRunnerSpec.js
index 94f8b79fd1df..cd3ddea7f33d 100644
--- a/test/ng/animateRunnerSpec.js
+++ b/test/ng/animateRunnerSpec.js
@@ -29,8 +29,8 @@ describe('$$animateAsyncRun', function() {
}));
});
-describe("$$AnimateRunner", function() {
- they("should trigger the host $prop function",
+describe('$$AnimateRunner', function() {
+ they('should trigger the host $prop function',
['end', 'cancel', 'pause', 'resume'], function(method) {
inject(function($$AnimateRunner) {
@@ -42,7 +42,7 @@ describe("$$AnimateRunner", function() {
});
});
- they("should trigger the inner runner's host $prop function",
+ they('should trigger the inner runner\'s host $prop function',
['end', 'cancel', 'pause', 'resume'], function(method) {
inject(function($$AnimateRunner) {
@@ -56,7 +56,7 @@ describe("$$AnimateRunner", function() {
});
});
- it("should resolve the done function only if one RAF has passed",
+ it('should resolve the done function only if one RAF has passed',
inject(function($$AnimateRunner, $$rAF) {
var runner = new $$AnimateRunner();
@@ -68,7 +68,7 @@ describe("$$AnimateRunner", function() {
expect(spy).toHaveBeenCalled();
}));
- it("should resolve with the status provided in the completion function",
+ it('should resolve with the status provided in the completion function',
inject(function($$AnimateRunner, $$rAF) {
var runner = new $$AnimateRunner();
@@ -81,7 +81,7 @@ describe("$$AnimateRunner", function() {
expect(capturedValue).toBe('special value');
}));
- they("should immediately resolve each combined runner in a bottom-up order when $prop is called",
+ they('should immediately resolve each combined runner in a bottom-up order when $prop is called',
['end', 'cancel'], function(method) {
inject(function($$AnimateRunner) {
@@ -109,7 +109,7 @@ describe("$$AnimateRunner", function() {
});
});
- they("should resolve/reject using a newly created promise when .then() is used upon $prop",
+ they('should resolve/reject using a newly created promise when .then() is used upon $prop',
['end', 'cancel'], function(method) {
inject(function($$AnimateRunner, $rootScope) {
@@ -140,14 +140,14 @@ describe("$$AnimateRunner", function() {
});
});
- it("should expose/create the contained promise when getPromise() is called",
+ it('should expose/create the contained promise when getPromise() is called',
inject(function($$AnimateRunner, $rootScope) {
var runner = new $$AnimateRunner();
expect(isPromiseLike(runner.getPromise())).toBeTruthy();
}));
- it("should expose the `catch` promise function to handle the rejected state",
+ it('should expose the `catch` promise function to handle the rejected state',
inject(function($$AnimateRunner, $rootScope) {
var runner = new $$AnimateRunner();
@@ -160,7 +160,7 @@ describe("$$AnimateRunner", function() {
expect(animationFailed).toBe(true);
}));
- it("should use timeouts to trigger async operations when the document is hidden", function() {
+ it('should use timeouts to trigger async operations when the document is hidden', function() {
var hidden = true;
module(function($provide) {
@@ -196,7 +196,7 @@ describe("$$AnimateRunner", function() {
});
});
- they("should expose the `finally` promise function to handle the final state when $prop",
+ they('should expose the `finally` promise function to handle the final state when $prop',
{ 'rejected': 'cancel', 'resolved': 'end' }, function(method) {
inject(function($$AnimateRunner, $rootScope) {
var runner = new $$AnimateRunner();
@@ -210,8 +210,8 @@ describe("$$AnimateRunner", function() {
});
});
- describe(".all()", function() {
- it("should resolve when all runners have naturally resolved",
+ describe('.all()', function() {
+ it('should resolve when all runners have naturally resolved',
inject(function($$rAF, $$AnimateRunner) {
var runner1 = new $$AnimateRunner();
@@ -234,7 +234,7 @@ describe("$$AnimateRunner", function() {
expect(status).toBe(true);
}));
- they("should immediately resolve if and when all runners have been $prop",
+ they('should immediately resolve if and when all runners have been $prop',
{ ended: 'end', cancelled: 'cancel' }, function(method) {
inject(function($$AnimateRunner) {
@@ -257,7 +257,7 @@ describe("$$AnimateRunner", function() {
});
});
- it("should return a status of `false` if one or more runners was cancelled",
+ it('should return a status of `false` if one or more runners was cancelled',
inject(function($$AnimateRunner) {
var runner1 = new $$AnimateRunner();
@@ -277,8 +277,8 @@ describe("$$AnimateRunner", function() {
}));
});
- describe(".chain()", function() {
- it("should evaluate an array of functions in a chain",
+ describe('.chain()', function() {
+ it('should evaluate an array of functions in a chain',
inject(function($$rAF, $$AnimateRunner) {
var runner1 = new $$AnimateRunner();
@@ -329,7 +329,7 @@ describe("$$AnimateRunner", function() {
expect(status).toBe(true);
}));
- it("should break the chian when a function evaluates to false",
+ it('should break the chian when a function evaluates to false',
inject(function($$rAF, $$AnimateRunner) {
var runner1 = new $$AnimateRunner();
diff --git a/test/ng/animateSpec.js b/test/ng/animateSpec.js
index eb98ed2811b9..9481a5619083 100644
--- a/test/ng/animateSpec.js
+++ b/test/ng/animateSpec.js
@@ -1,8 +1,8 @@
'use strict';
-describe("$animate", function() {
+describe('$animate', function() {
- describe("without animation", function() {
+ describe('without animation', function() {
var element, $rootElement;
beforeEach(module(function() {
@@ -12,14 +12,14 @@ describe("$animate", function() {
};
}));
- it("should add element at the start of enter animation", inject(function($animate, $compile, $rootScope) {
+ it('should add element at the start of enter animation', inject(function($animate, $compile, $rootScope) {
var child = $compile('
')($rootScope);
expect(element.contents().length).toBe(0);
$animate.enter(child, element);
expect(element.contents().length).toBe(1);
}));
- it("should enter the element to the start of the parent container",
+ it('should enter the element to the start of the parent container',
inject(function($animate, $compile, $rootScope) {
for (var i = 0; i < 5; i++) {
@@ -32,7 +32,7 @@ describe("$animate", function() {
expect(element.text()).toEqual('first 0 1 2 3 4');
}));
- it("should remove the element at the end of leave animation", inject(function($animate, $compile, $rootScope) {
+ it('should remove the element at the end of leave animation', inject(function($animate, $compile, $rootScope) {
var child = $compile('
')($rootScope);
element.append(child);
expect(element.contents().length).toBe(1);
@@ -40,7 +40,7 @@ describe("$animate", function() {
expect(element.contents().length).toBe(0);
}));
- it("should reorder the move animation", inject(function($animate, $compile, $rootScope) {
+ it('should reorder the move animation', inject(function($animate, $compile, $rootScope) {
var child1 = $compile('1
')($rootScope);
var child2 = $compile('2
')($rootScope);
element.append(child1);
@@ -50,7 +50,7 @@ describe("$animate", function() {
expect(element.text()).toBe('21');
}));
- it("should apply styles instantly to the element",
+ it('should apply styles instantly to the element',
inject(function($animate, $compile, $rootScope) {
$animate.animate(element, { color: 'rgb(0, 0, 0)' });
@@ -60,7 +60,7 @@ describe("$animate", function() {
expect(element.css('color')).toBe('rgb(0, 255, 0)');
}));
- it("should still perform DOM operations even if animations are disabled (post-digest)", inject(function($animate, $rootScope) {
+ it('should still perform DOM operations even if animations are disabled (post-digest)', inject(function($animate, $rootScope) {
$animate.enabled(false);
expect(element).toBeShown();
$animate.addClass(element, 'ng-hide');
@@ -68,7 +68,7 @@ describe("$animate", function() {
expect(element).toBeHidden();
}));
- it("should run each method and return a promise", inject(function($animate, $document) {
+ it('should run each method and return a promise', inject(function($animate, $document) {
var element = jqLite('
');
var move = jqLite('
');
var parent = jqLite($document[0].body);
@@ -82,17 +82,17 @@ describe("$animate", function() {
expect($animate.leave(element)).toBeAPromise();
}));
- it("should provide the `enabled` and `cancel` methods", inject(function($animate) {
+ it('should provide the `enabled` and `cancel` methods', inject(function($animate) {
expect($animate.enabled()).toBeUndefined();
expect($animate.cancel({})).toBeUndefined();
}));
- it("should provide the `on` and `off` methods", inject(function($animate) {
+ it('should provide the `on` and `off` methods', inject(function($animate) {
expect(isFunction($animate.on)).toBe(true);
expect(isFunction($animate.off)).toBe(true);
}));
- it("should add and remove classes on SVG elements", inject(function($animate, $rootScope) {
+ it('should add and remove classes on SVG elements', inject(function($animate, $rootScope) {
if (!window.SVGElement) return;
var svg = jqLite(' ');
var rect = svg.children();
@@ -106,16 +106,16 @@ describe("$animate", function() {
expect(rect).not.toBeHidden();
}));
- it("should throw error on wrong selector", function() {
+ it('should throw error on wrong selector', function() {
module(function($animateProvider) {
expect(function() {
$animateProvider.register('abc', null);
- }).toThrowMinErr("$animate", "notcsel", "Expecting class selector starting with '.' got 'abc'.");
+ }).toThrowMinErr('$animate', 'notcsel', 'Expecting class selector starting with \'.\' got \'abc\'.');
});
inject();
});
- it("should register the animation and be available for lookup", function() {
+ it('should register the animation and be available for lookup', function() {
var provider;
module(function($animateProvider) {
provider = $animateProvider;
@@ -130,7 +130,7 @@ describe("$animate", function() {
});
});
- it("should apply and retain inline styles on the element that is animated", inject(function($animate, $rootScope) {
+ it('should apply and retain inline styles on the element that is animated', inject(function($animate, $rootScope) {
var element = jqLite('
');
var parent = jqLite('
');
var other = jqLite('
');
@@ -176,7 +176,7 @@ describe("$animate", function() {
}
}));
- it("should merge the from and to styles that are provided",
+ it('should merge the from and to styles that are provided',
inject(function($animate, $rootScope) {
var element = jqLite('
');
@@ -193,7 +193,7 @@ describe("$animate", function() {
expect(style.borderColor).toBe('purple');
}));
- it("should avoid cancelling out add/remove when the element already contains the class",
+ it('should avoid cancelling out add/remove when the element already contains the class',
inject(function($animate, $rootScope) {
var element = jqLite('
');
@@ -205,7 +205,7 @@ describe("$animate", function() {
expect(element).not.toHaveClass('ng-hide');
}));
- it("should avoid cancelling out remove/add if the element does not contain the class",
+ it('should avoid cancelling out remove/add if the element does not contain the class',
inject(function($animate, $rootScope) {
var element = jqLite('
');
@@ -217,7 +217,7 @@ describe("$animate", function() {
expect(element).toHaveClass('ng-hide');
}));
- they("should accept an unwrapped \"parent\" element for the $prop event",
+ they('should accept an unwrapped "parent" element for the $prop event',
['enter', 'move'], function(method) {
inject(function($document, $animate, $rootElement) {
@@ -230,7 +230,7 @@ describe("$animate", function() {
});
});
- they("should accept an unwrapped \"after\" element for the $prop event",
+ they('should accept an unwrapped "after" element for the $prop event',
['enter', 'move'], function(method) {
inject(function($document, $animate, $rootElement) {
@@ -378,7 +378,7 @@ describe("$animate", function() {
});
});
- it("should not alter the provided options input in any way throughout the animation", inject(function($animate, $rootElement, $rootScope) {
+ it('should not alter the provided options input in any way throughout the animation', inject(function($animate, $rootElement, $rootScope) {
var element = jqLite('
');
var parent = $rootElement;
diff --git a/test/ng/browserSpecs.js b/test/ng/browserSpecs.js
index 2777d616763a..5c55800d7134 100755
--- a/test/ng/browserSpecs.js
+++ b/test/ng/browserSpecs.js
@@ -337,7 +337,7 @@ describe('browser', function() {
expect(locationReplace).not.toHaveBeenCalled();
});
- it("should retain the # character when the only change is clearing the hash fragment, to prevent page reload", function() {
+ it('should retain the # character when the only change is clearing the hash fragment, to prevent page reload', function() {
sniffer.history = true;
browser.url('http://server/#123');
@@ -384,8 +384,8 @@ describe('browser', function() {
});
it('should decode single quotes to work around FF bug 407273', function() {
- fakeWindow.location.href = "http://ff-bug/?single%27quote";
- expect(browser.url()).toBe("http://ff-bug/?single'quote");
+ fakeWindow.location.href = 'http://ff-bug/?single%27quote';
+ expect(browser.url()).toBe('http://ff-bug/?single\'quote');
});
it('should not set URL when the URL is already set', function() {
@@ -733,7 +733,7 @@ describe('browser', function() {
});
- it("should stop calling callbacks when application has been torn down", function() {
+ it('should stop calling callbacks when application has been torn down', function() {
sniffer.history = true;
browser.onUrlChange(callback);
fakeWindow.location.href = 'http://server/new';
diff --git a/test/ng/cacheFactorySpec.js b/test/ng/cacheFactorySpec.js
index cb65a1740679..ddfd8a2819e9 100644
--- a/test/ng/cacheFactorySpec.js
+++ b/test/ng/cacheFactorySpec.js
@@ -17,7 +17,7 @@ describe('$cacheFactory', function() {
it('should complain if the cache id is being reused', inject(function($cacheFactory) {
$cacheFactory('cache1');
expect(function() { $cacheFactory('cache1'); }).
- toThrowMinErr("$cacheFactory", "iid", "CacheId 'cache1' is already taken!");
+ toThrowMinErr('$cacheFactory', 'iid', 'CacheId \'cache1\' is already taken!');
}));
@@ -108,7 +108,7 @@ describe('$cacheFactory', function() {
}));
- it("should return value from put", inject(function($cacheFactory) {
+ it('should return value from put', inject(function($cacheFactory) {
var obj = {};
expect(cache.put('k1', obj)).toBe(obj);
}));
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index cac88465c7dd..800fb1be9d27 100755
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -70,7 +70,7 @@ describe('$compile', function() {
directive('greet', function() {
return { restrict: 'CAM', priority:10, compile: valueFn(function(scope, element, attrs) {
- element.text("Hello " + attrs.greet);
+ element.text('Hello ' + attrs.greet);
})};
});
@@ -201,7 +201,7 @@ describe('$compile', function() {
module(function() {
expect(function() {
directive('hasOwnProperty', function() { });
- }).toThrowMinErr('ng','badname', "hasOwnProperty is not a valid directive name");
+ }).toThrowMinErr('ng','badname', 'hasOwnProperty is not a valid directive name');
});
inject(function($compile) {});
});
@@ -210,7 +210,7 @@ describe('$compile', function() {
module(function() {
expect(function() {
directive('BadDirectiveName', function() { });
- }).toThrowMinErr('$compile','baddir', "Directive/Component name 'BadDirectiveName' is invalid. The first character must be a lowercase letter");
+ }).toThrowMinErr('$compile','baddir', 'Directive/Component name \'BadDirectiveName\' is invalid. The first character must be a lowercase letter');
});
inject(function($compile) {});
});
@@ -221,7 +221,7 @@ describe('$compile', function() {
directive(name, function() { });
}).toThrowMinErr(
'$compile','baddir', 'Directive/Component name \'' + name + '\' is invalid. ' +
- "The name should not contain leading or trailing whitespaces");
+ 'The name should not contain leading or trailing whitespaces');
}
assertLeadingOrTrailingWhitespaceInDirectiveName(' leadingWhitespaceDirectiveName');
assertLeadingOrTrailingWhitespaceInDirectiveName('trailingWhitespaceDirectiveName ');
@@ -535,7 +535,7 @@ describe('$compile', function() {
$rootScope.$apply();
// object's children can't be compiled in this case, so we expect them to be raw
- expect(element.html()).toBe("3");
+ expect(element.html()).toBe('3');
}));
it('should detect anchor elements with the string "SVG" in the `href` attribute as an anchor', inject(function($compile, $rootScope) {
@@ -685,7 +685,7 @@ describe('$compile', function() {
}));
});
inject(function($compile, $rootScope, log) {
- element = jqLite("");
+ element = jqLite('');
$compile(element)($rootScope);
expect(element.text()).toBe('AB');
expect(log).toEqual('LOG');
@@ -1128,7 +1128,7 @@ describe('$compile', function() {
});
});
- it("should fail if replacing and template doesn't have a single root element", function() {
+ it('should fail if replacing and template doesn\'t have a single root element', function() {
module(function() {
directive('noRootElem', function() {
return {
@@ -1153,11 +1153,11 @@ describe('$compile', function() {
inject(function($compile) {
expect(function() {
$compile('
');
- }).toThrowMinErr("$compile", "tplrt", "Template for directive 'noRootElem' must have exactly one root element. ");
+ }).toThrowMinErr('$compile', 'tplrt', 'Template for directive \'noRootElem\' must have exactly one root element. ');
expect(function() {
$compile('
');
- }).toThrowMinErr("$compile", "tplrt", "Template for directive 'multiRootElem' must have exactly one root element. ");
+ }).toThrowMinErr('$compile', 'tplrt', 'Template for directive \'multiRootElem\' must have exactly one root element. ');
// ws is ok
expect(function() {
@@ -1240,7 +1240,7 @@ describe('$compile', function() {
$rootScope.$digest();
expect(nodeName_(child)).toMatch(/a/i);
expect(isSVGElement(child[0])).toBe(true);
- expect(child[0].href.baseVal).toBe("/foo/bar");
+ expect(child[0].href.baseVal).toBe('/foo/bar');
});
});
@@ -1295,12 +1295,12 @@ describe('$compile', function() {
module(function() {
function DirectiveClass() {
this.restrict = 'E';
- this.template = "{{value}}
";
+ this.template = '{{value}}
';
}
DirectiveClass.prototype.compile = function() {
return function(scope, element, attrs) {
- scope.value = "Test Value";
+ scope.value = 'Test Value';
};
};
@@ -1310,7 +1310,7 @@ describe('$compile', function() {
inject(function($compile, $rootScope) {
element = $compile('')($rootScope);
$rootScope.$digest();
- expect(element.find("p")[0].innerHTML).toEqual("Test Value");
+ expect(element.find('p')[0].innerHTML).toEqual('Test Value');
});
});
});
@@ -1987,7 +1987,7 @@ describe('$compile', function() {
));
- it("should fail if replacing and template doesn't have a single root element", function() {
+ it('should fail if replacing and template doesn\'t have a single root element', function() {
module(function($exceptionHandlerProvider) {
$exceptionHandlerProvider.mode('log');
@@ -2175,7 +2175,7 @@ describe('$compile', function() {
var child = element.children().eq(0);
expect(nodeName_(child)).toMatch(/a/i);
expect(isSVGElement(child[0])).toBe(true);
- expect(child[0].href.baseVal).toBe("/foo/bar");
+ expect(child[0].href.baseVal).toBe('/foo/bar');
});
});
@@ -2234,12 +2234,12 @@ describe('$compile', function() {
module(function() {
function DirectiveClass() {
this.restrict = 'E';
- this.templateUrl = "test.html";
+ this.templateUrl = 'test.html';
}
DirectiveClass.prototype.compile = function() {
return function(scope, element, attrs) {
- scope.value = "Test Value";
+ scope.value = 'Test Value';
};
};
@@ -2252,7 +2252,7 @@ describe('$compile', function() {
element = $compile('')($rootScope);
$httpBackend.flush();
$rootScope.$digest();
- expect(element.find("p")[0].innerHTML).toEqual("Test Value");
+ expect(element.find('p')[0].innerHTML).toEqual('Test Value');
});
});
@@ -3253,7 +3253,7 @@ describe('$compile', function() {
var base = jqLite('— {{ "This doesn\'t." }}
');
element = $compile(base)($rootScope);
$rootScope.$digest();
- expect(element.text()).toBe("— This doesn't.");
+ expect(element.text()).toBe('— This doesn\'t.');
// Unregister the MutationObserver (and hope it doesn't mess up with subsequent tests)
observer.disconnect();
@@ -5058,7 +5058,7 @@ describe('$compile', function() {
componentScope.ref = 'ignore me';
expect(function() { $rootScope.$apply(); }).
- toThrowMinErr("$compile", "nonassign", "Expression ''hello ' + name' in attribute 'ref' used with directive 'myComponent' is non-assignable!");
+ toThrowMinErr('$compile', 'nonassign', 'Expression \'\'hello \' + name\' in attribute \'ref\' used with directive \'myComponent\' is non-assignable!');
expect(componentScope.ref).toBe('hello world');
// reset since the exception was rethrown which prevented phase clearing
$rootScope.$$phase = null;
@@ -5075,7 +5075,7 @@ describe('$compile', function() {
componentScope.ref = 'ignore me';
expect(function() { $rootScope.$apply(); }).
- toThrowMinErr("$compile", "nonassign", "Expression 'undefined' in attribute 'ref' used with directive 'myComponent' is non-assignable!");
+ toThrowMinErr('$compile', 'nonassign', 'Expression \'undefined\' in attribute \'ref\' used with directive \'myComponent\' is non-assignable!');
expect(componentScope.ref).toBeUndefined();
$rootScope.$$phase = null; // reset since the exception was rethrown which prevented phase clearing
@@ -5132,7 +5132,7 @@ describe('$compile', function() {
componentScope.reference = {name: 'b'};
expect(function() {
$rootScope.$apply();
- }).toThrowMinErr("$compile", "nonassign", "Expression '{name: name}' in attribute 'reference' used with directive 'myComponent' is non-assignable!");
+ }).toThrowMinErr('$compile', 'nonassign', 'Expression \'{name: name}\' in attribute \'reference\' used with directive \'myComponent\' is non-assignable!');
}));
@@ -5140,7 +5140,7 @@ describe('$compile', function() {
test('1', 1);
test('null', null);
test('undefined', undefined);
- test("'someString'", 'someString');
+ test('\'someString\'', 'someString');
test('true', true);
function test(literalString, literalValue) {
@@ -5193,7 +5193,7 @@ describe('$compile', function() {
name: 'Tony',
value: 91
}];
- $rootScope.query = "";
+ $rootScope.query = '';
$rootScope.$apply();
compile('');
@@ -5201,7 +5201,7 @@ describe('$compile', function() {
expect(componentScope.colref).toEqual($rootScope.collection);
expect(componentScope.colrefAlias).toEqual(componentScope.colref);
- $rootScope.query = "Gab";
+ $rootScope.query = 'Gab';
$rootScope.$apply();
expect(componentScope.colref).toEqual([$rootScope.collection[0]]);
@@ -5548,7 +5548,7 @@ describe('$compile', function() {
test('1', 1);
test('null', null);
test('undefined', undefined);
- test("'someString'", 'someString');
+ test('\'someString\'', 'someString');
test('true', true);
function test(literalString, literalValue) {
@@ -5606,7 +5606,7 @@ describe('$compile', function() {
it('should throw on unknown definition', inject(function() {
expect(function() {
compile('');
- }).toThrowMinErr("$compile", "iscp", "Invalid isolate scope definition for directive 'badDeclaration'. Definition: {... attr: 'xxx' ...}");
+ }).toThrowMinErr('$compile', 'iscp', 'Invalid isolate scope definition for directive \'badDeclaration\'. Definition: {... attr: \'xxx\' ...}');
}));
it('should expose a $$isolateBindings property onto the scope', inject(function() {
@@ -5687,23 +5687,23 @@ describe('$compile', function() {
var controllerCalled = false;
// eslint-disable-next-line no-eval
var Controller = eval(
- "class Foo {\n" +
- " constructor($scope) {}\n" +
- " $onInit() { this.check(); }\n" +
- " check() {\n" +
- " expect(this.data).toEqualData({\n" +
- " 'foo': 'bar',\n" +
- " 'baz': 'biz'\n" +
- " });\n" +
- " expect(this.oneway).toEqualData({\n" +
- " 'foo': 'bar',\n" +
- " 'baz': 'biz'\n" +
- " });\n" +
- " expect(this.str).toBe('Hello, world!');\n" +
- " expect(this.fn()).toBe('called!');\n" +
- " controllerCalled = true;\n" +
- " }\n" +
- "}");
+ 'class Foo {\n' +
+ ' constructor($scope) {}\n' +
+ ' $onInit() { this.check(); }\n' +
+ ' check() {\n' +
+ ' expect(this.data).toEqualData({\n' +
+ ' \'foo\': \'bar\',\n' +
+ ' \'baz\': \'biz\'\n' +
+ ' });\n' +
+ ' expect(this.oneway).toEqualData({\n' +
+ ' \'foo\': \'bar\',\n' +
+ ' \'baz\': \'biz\'\n' +
+ ' });\n' +
+ ' expect(this.str).toBe(\'Hello, world!\');\n' +
+ ' expect(this.fn()).toBe(\'called!\');\n' +
+ ' controllerCalled = true;\n' +
+ ' }\n' +
+ '}');
spyOn(Controller.prototype, '$onInit').and.callThrough();
module(function($compileProvider) {
@@ -6755,7 +6755,7 @@ describe('$compile', function() {
inject(function($compile, $rootScope) {
expect(function() {
element = $compile('
')($rootScope);
- }).toThrowMinErr('$compile', 'ctreq', "Controller 'nested', required by directive 'nested', can't be found!");
+ }).toThrowMinErr('$compile', 'ctreq', 'Controller \'nested\', required by directive \'nested\', can\'t be found!');
});
});
@@ -7353,7 +7353,7 @@ describe('$compile', function() {
});
- it("should throw an error if required controller can't be found",function() {
+ it('should throw an error if required controller can\'t be found',function() {
module(function() {
directive('dep', function(log) {
return {
@@ -7367,12 +7367,12 @@ describe('$compile', function() {
inject(function(log, $compile, $rootScope) {
expect(function() {
$compile('')($rootScope);
- }).toThrowMinErr("$compile", "ctreq", "Controller 'main', required by directive 'dep', can't be found!");
+ }).toThrowMinErr('$compile', 'ctreq', 'Controller \'main\', required by directive \'dep\', can\'t be found!');
});
});
- it("should pass null if required controller can't be found and is optional",function() {
+ it('should pass null if required controller can\'t be found and is optional',function() {
module(function() {
directive('dep', function(log) {
return {
@@ -7390,7 +7390,7 @@ describe('$compile', function() {
});
- it("should pass null if required controller can't be found and is optional with the question mark on the right",function() {
+ it('should pass null if required controller can\'t be found and is optional with the question mark on the right',function() {
module(function() {
directive('dep', function(log) {
return {
@@ -7585,7 +7585,7 @@ describe('$compile', function() {
directive('myDirective', function() {
return {
scope: {
- myFoo: "="
+ myFoo: '='
},
template: 'Hello
',
controller: Ctrl
@@ -7594,7 +7594,7 @@ describe('$compile', function() {
});
inject(function($templateCache, $compile, $rootScope, log) {
- $rootScope.foo = "bar";
+ $rootScope.foo = 'bar';
element = $compile('
')($rootScope);
$rootScope.$apply();
@@ -7612,7 +7612,7 @@ describe('$compile', function() {
directive('myDirective', function() {
return {
scope: {
- myFoo: "="
+ myFoo: '='
},
templateUrl: 'hello.html',
controller: Ctrl
@@ -7622,7 +7622,7 @@ describe('$compile', function() {
inject(function($templateCache, $compile, $rootScope, log) {
$templateCache.put('hello.html', 'Hello
');
- $rootScope.foo = "bar";
+ $rootScope.foo = 'bar';
element = $compile('
')($rootScope);
$rootScope.$apply();
@@ -7747,8 +7747,8 @@ describe('$compile', function() {
it('should throw ctreq with correct directive name, regardless of order', function() {
module(function($compileProvider) {
$compileProvider.directive('aDir', valueFn({
- restrict: "E",
- require: "ngModel",
+ restrict: 'E',
+ require: 'ngModel',
link: noop
}));
});
@@ -7760,7 +7760,7 @@ describe('$compile', function() {
// affect which directive is referenced in the minErr message.
element = $compile(' ')($rootScope);
}).toThrowMinErr('$compile', 'ctreq',
- "Controller 'ngModel', required by directive 'aDir', can't be found!");
+ 'Controller \'ngModel\', required by directive \'aDir\', can\'t be found!');
});
});
});
@@ -7844,15 +7844,15 @@ describe('$compile', function() {
});
inject(function($rootScope, $compile) {
element = $compile('')($rootScope);
- $rootScope.before = "BEFORE";
- $rootScope.after = "AFTER";
+ $rootScope.before = 'BEFORE';
+ $rootScope.after = 'AFTER';
$rootScope.$apply();
expect(element.text()).toEqual('This is before BEFORE. This is after AFTER');
- $rootScope.before = "Not-Before";
- $rootScope.after = "AfTeR";
- $rootScope.$$childHead.before = "BeFoRe";
- $rootScope.$$childHead.after = "Not-After";
+ $rootScope.before = 'Not-Before';
+ $rootScope.after = 'AfTeR';
+ $rootScope.$$childHead.before = 'BeFoRe';
+ $rootScope.$$childHead.after = 'Not-After';
$rootScope.$apply();
expect(element.text()).toEqual('This is before BeFoRe. This is after AfTeR');
});
@@ -8115,7 +8115,7 @@ describe('$compile', function() {
//Ensure the angular $destroy event is still sent
var destroyCount = 0;
- element.find("div").on("$destroy", function() { destroyCount++; });
+ element.find('div').on('$destroy', function() { destroyCount++; });
$rootScope.$apply('xs = null');
@@ -9085,7 +9085,7 @@ describe('$compile', function() {
describe('multiple siblings receiving transclusion', function() {
- it("should only receive transclude from parent", function() {
+ it('should only receive transclude from parent', function() {
module(function($compileProvider) {
@@ -9458,9 +9458,9 @@ describe('$compile', function() {
var child = element.children();
expect(log.toArray()).toEqual([
- "outer:#comment:outer:",
- "innerAgain:#comment:innerAgain:",
- "inner:#comment:innerAgain:"
+ 'outer:#comment:outer:',
+ 'innerAgain:#comment:innerAgain:',
+ 'inner:#comment:innerAgain:'
]);
expect(child.length).toBe(1);
expect(child.contents().length).toBe(2);
@@ -9527,7 +9527,7 @@ describe('$compile', function() {
describe('lazy compilation', function() {
// See https://github.com/angular/angular.js/issues/7183
- it("should pass transclusion through to template of a 'replace' directive", function() {
+ it('should pass transclusion through to template of a \'replace\' directive', function() {
module(function() {
directive('transSync', function() {
return {
@@ -9556,7 +9556,7 @@ describe('$compile', function() {
directive('replaceWithTemplate', function() {
return {
- templateUrl: "template.html",
+ templateUrl: 'template.html',
replace: true
};
});
@@ -10154,7 +10154,7 @@ describe('$compile', function() {
it('should not sanitize attributes other than src', inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "javascript:doEvilStuff()";
+ $rootScope.testUrl = 'javascript:doEvilStuff()';
$rootScope.$apply();
expect(element.attr('title')).toBe('javascript:doEvilStuff()');
@@ -10183,7 +10183,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "someUrl";
+ $rootScope.testUrl = 'someUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10234,7 +10234,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "someUrl";
+ $rootScope.testUrl = 'someUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10286,7 +10286,7 @@ describe('$compile', function() {
it('should not sanitize href on elements other than anchor', inject(function($compile, $rootScope) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = "javascript:doEvilStuff()";
+ $rootScope.testUrl = 'javascript:doEvilStuff()';
$rootScope.$apply();
expect(element.attr('href')).toBe('javascript:doEvilStuff()');
@@ -10294,7 +10294,7 @@ describe('$compile', function() {
it('should not sanitize attributes other than href', inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "javascript:doEvilStuff()";
+ $rootScope.testUrl = 'javascript:doEvilStuff()';
$rootScope.$apply();
expect(element.attr('title')).toBe('javascript:doEvilStuff()');
@@ -10323,7 +10323,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "someUrl";
+ $rootScope.testUrl = 'someUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10339,7 +10339,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "someUrl";
+ $rootScope.testUrl = 'someUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10355,7 +10355,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "evilUrl";
+ $rootScope.testUrl = 'evilUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10372,7 +10372,7 @@ describe('$compile', function() {
});
inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "evilUrl";
+ $rootScope.testUrl = 'evilUrl';
$$sanitizeUri.and.returnValue('someSanitizedUrl');
$rootScope.$apply();
@@ -10385,22 +10385,22 @@ describe('$compile', function() {
describe('interpolation on HTML DOM event handler attributes onclick, onXYZ, formaction', function() {
it('should disallow interpolation on onclick', inject(function($compile, $rootScope) {
// All interpolations are disallowed.
- $rootScope.onClickJs = "";
+ $rootScope.onClickJs = '';
expect(function() {
$compile('');
}).toThrowMinErr(
- "$compile", "nodomevents", "Interpolations for HTML DOM event attributes are disallowed. " +
- "Please use the ng- versions (such as ng-click instead of onclick) instead.");
+ '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed. ' +
+ 'Please use the ng- versions (such as ng-click instead of onclick) instead.');
expect(function() {
$compile('');
}).toThrowMinErr(
- "$compile", "nodomevents", "Interpolations for HTML DOM event attributes are disallowed. " +
- "Please use the ng- versions (such as ng-click instead of onclick) instead.");
+ '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed. ' +
+ 'Please use the ng- versions (such as ng-click instead of onclick) instead.');
expect(function() {
$compile('');
}).toThrowMinErr(
- "$compile", "nodomevents", "Interpolations for HTML DOM event attributes are disallowed. " +
- "Please use the ng- versions (such as ng-click instead of onclick) instead.");
+ '$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed. ' +
+ 'Please use the ng- versions (such as ng-click instead of onclick) instead.');
}));
it('should pass through arbitrary values on onXYZ event attributes that contain a hyphen', inject(function($compile, $rootScope) {
@@ -10426,40 +10426,40 @@ describe('$compile', function() {
describe('iframe[src]', function() {
it('should pass through src attributes for the same domain', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "different_page";
+ $rootScope.testUrl = 'different_page';
$rootScope.$apply();
expect(element.attr('src')).toEqual('different_page');
}));
it('should clear out src attributes for a different domain', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "http://a.different.domain.example.com";
+ $rootScope.testUrl = 'http://a.different.domain.example.com';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "http://a.different.domain.example.com");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'http://a.different.domain.example.com');
}));
it('should clear out JS src attributes', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "javascript:alert(1);";
+ $rootScope.testUrl = 'javascript:alert(1);';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "javascript:alert(1);");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'javascript:alert(1);');
}));
it('should clear out non-resource_url src attributes', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsUrl('javascript:doTrustedStuff()');
expect($rootScope.$apply).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()');
}));
it('should pass through $sce.trustAs() values in src attributes', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = $sce.trustAsResourceUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsResourceUrl('javascript:doTrustedStuff()');
$rootScope.$apply();
expect(element.attr('src')).toEqual('javascript:doTrustedStuff()');
@@ -10469,41 +10469,41 @@ describe('$compile', function() {
describe('form[action]', function() {
it('should pass through action attribute for the same domain', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "different_page";
+ $rootScope.testUrl = 'different_page';
$rootScope.$apply();
expect(element.attr('action')).toEqual('different_page');
}));
it('should clear out action attribute for a different domain', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "http://a.different.domain.example.com";
+ $rootScope.testUrl = 'http://a.different.domain.example.com';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "http://a.different.domain.example.com");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'http://a.different.domain.example.com');
}));
it('should clear out JS action attribute', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = "javascript:alert(1);";
+ $rootScope.testUrl = 'javascript:alert(1);';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "javascript:alert(1);");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'javascript:alert(1);');
}));
it('should clear out non-resource_url action attribute', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsUrl('javascript:doTrustedStuff()');
expect($rootScope.$apply).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: javascript:doTrustedStuff()');
}));
it('should pass through $sce.trustAs() values in action attribute', inject(function($compile, $rootScope, $sce) {
element = $compile('')($rootScope);
- $rootScope.testUrl = $sce.trustAsResourceUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsResourceUrl('javascript:doTrustedStuff()');
$rootScope.$apply();
expect(element.attr('action')).toEqual('javascript:doTrustedStuff()');
@@ -10513,17 +10513,17 @@ describe('$compile', function() {
describe('link[href]', function() {
it('should reject invalid RESOURCE_URLs', inject(function($compile, $rootScope) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "https://evil.example.org/css.css";
+ $rootScope.testUrl = 'https://evil.example.org/css.css';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "https://evil.example.org/css.css");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'https://evil.example.org/css.css');
}));
it('should accept valid RESOURCE_URLs', inject(function($compile, $rootScope, $sce) {
element = $compile(' ')($rootScope);
- $rootScope.testUrl = "./css1.css";
+ $rootScope.testUrl = './css1.css';
$rootScope.$apply();
expect(element.attr('href')).toContain('css1.css');
@@ -10570,7 +10570,7 @@ describe('$compile', function() {
describe('ngAttr* attribute binding', function() {
it('should bind after digest but not before', inject(function($compile, $rootScope) {
- $rootScope.name = "Misko";
+ $rootScope.name = 'Misko';
element = $compile(' ')($rootScope);
expect(element.attr('test')).toBeUndefined();
$rootScope.$digest();
@@ -10578,7 +10578,7 @@ describe('$compile', function() {
}));
it('should bind after digest but not before when after overridden attribute', inject(function($compile, $rootScope) {
- $rootScope.name = "Misko";
+ $rootScope.name = 'Misko';
element = $compile(' ')($rootScope);
expect(element.attr('test')).toBe('123');
$rootScope.$digest();
@@ -10586,7 +10586,7 @@ describe('$compile', function() {
}));
it('should bind after digest but not before when before overridden attribute', inject(function($compile, $rootScope) {
- $rootScope.name = "Misko";
+ $rootScope.name = 'Misko';
element = $compile(' ')($rootScope);
expect(element.attr('test')).toBe('123');
$rootScope.$digest();
@@ -10632,7 +10632,7 @@ describe('$compile', function() {
it('should provide post-digest value in synchronous directive link functions when after overridden attribute',
inject(function(log, $rootScope, $compile) {
- $rootScope.test = "TEST";
+ $rootScope.test = 'TEST';
element = $compile('
')($rootScope);
expect(element.attr('test')).toBe('123');
expect(log.toArray()).toEqual(['TEST', 'TEST']);
@@ -10640,7 +10640,7 @@ describe('$compile', function() {
it('should provide post-digest value in synchronous directive link functions when before overridden attribute',
inject(function(log, $rootScope, $compile) {
- $rootScope.test = "TEST";
+ $rootScope.test = 'TEST';
element = $compile('
')($rootScope);
expect(element.attr('test')).toBe('123');
expect(log.toArray()).toEqual(['TEST', 'TEST']);
@@ -10649,7 +10649,7 @@ describe('$compile', function() {
it('should provide post-digest value in asynchronous directive link functions when after overridden attribute',
inject(function(log, $rootScope, $compile) {
- $rootScope.test = "TEST";
+ $rootScope.test = 'TEST';
element = $compile('
')($rootScope);
expect(element.attr('test')).toBe('123');
$rootScope.$digest();
@@ -10658,7 +10658,7 @@ describe('$compile', function() {
it('should provide post-digest value in asynchronous directive link functions when before overridden attribute',
inject(function(log, $rootScope, $compile) {
- $rootScope.test = "TEST";
+ $rootScope.test = 'TEST';
element = $compile('
')($rootScope);
expect(element.attr('test')).toBe('123');
$rootScope.$digest();
@@ -10667,7 +10667,7 @@ describe('$compile', function() {
});
it('should work with different prefixes', inject(function($compile, $rootScope) {
- $rootScope.name = "Misko";
+ $rootScope.name = 'Misko';
element = $compile(' ')($rootScope);
expect(element.attr('test')).toBeUndefined();
expect(element.attr('test2')).toBeUndefined();
@@ -10686,7 +10686,7 @@ describe('$compile', function() {
}));
it('should work if they are prefixed with x- or data- and different prefixes', inject(function($compile, $rootScope) {
- $rootScope.name = "Misko";
+ $rootScope.name = 'Misko';
element = $compile(' ')($rootScope);
expect(element.attr('test2')).toBeUndefined();
@@ -10705,7 +10705,7 @@ describe('$compile', function() {
describe('when an attribute has a dash-separated name', function() {
it('should work with different prefixes', inject(function($compile, $rootScope) {
- $rootScope.name = "JamieMason";
+ $rootScope.name = 'JamieMason';
element = $compile(' ')($rootScope);
expect(element.attr('dash-test')).toBeUndefined();
expect(element.attr('dash-test2')).toBeUndefined();
@@ -10717,7 +10717,7 @@ describe('$compile', function() {
}));
it('should work if they are prefixed with x- or data-', inject(function($compile, $rootScope) {
- $rootScope.name = "JamieMason";
+ $rootScope.name = 'JamieMason';
element = $compile(' ')($rootScope);
expect(element.attr('dash-test2')).toBeUndefined();
expect(element.attr('dash-test3')).toBeUndefined();
@@ -10770,7 +10770,7 @@ describe('$compile', function() {
describe('when an attribute has an underscore-separated name', function() {
it('should work with different prefixes', inject(function($compile, $rootScope) {
- $rootScope.dimensions = "0 0 0 0";
+ $rootScope.dimensions = '0 0 0 0';
element = $compile(' ')($rootScope);
expect(element.attr('viewBox')).toBeUndefined();
$rootScope.$digest();
@@ -10778,7 +10778,7 @@ describe('$compile', function() {
}));
it('should work if they are prefixed with x- or data-', inject(function($compile, $rootScope) {
- $rootScope.dimensions = "0 0 0 0";
+ $rootScope.dimensions = '0 0 0 0';
$rootScope.number = 0.42;
$rootScope.scale = 1;
element = $compile('' +
@@ -10851,7 +10851,7 @@ describe('$compile', function() {
it('should group on nested groups', function() {
module(function($compileProvider) {
- $compileProvider.directive("ngMultiBind", valueFn({
+ $compileProvider.directive('ngMultiBind', valueFn({
multiElement: true,
link: function(scope, element, attr) {
element.text(scope.$eval(attr.ngMultiBind));
@@ -11073,7 +11073,7 @@ describe('$compile', function() {
'' +
' ' +
'
');
- }).toThrowMinErr("$compile", "uterdir", "Unterminated attribute, found 'foo-start' but no matching 'foo-end' found.");
+ }).toThrowMinErr('$compile', 'uterdir', 'Unterminated attribute, found \'foo-start\' but no matching \'foo-end\' found.');
});
});
@@ -11128,7 +11128,7 @@ describe('$compile', function() {
'' +
' ' +
'
');
- }).toThrowMinErr("$compile", "uterdir", "Unterminated attribute, found 'foo-start' but no matching 'foo-end' found.");
+ }).toThrowMinErr('$compile', 'uterdir', 'Unterminated attribute, found \'foo-start\' but no matching \'foo-end\' found.');
});
});
@@ -11269,10 +11269,10 @@ describe('$compile', function() {
linkedElements.remove();
forEach(preCompiledChildren, function(element, i) {
- expect(jqLite.hasData(element)).toBe(false, "template#" + i);
+ expect(jqLite.hasData(element)).toBe(false, 'template#' + i);
});
forEach(getAll(linkedElements), function(element, i) {
- expect(jqLite.hasData(element)).toBe(false, "linked#" + i);
+ expect(jqLite.hasData(element)).toBe(false, 'linked#' + i);
});
});
}
diff --git a/test/ng/controllerSpec.js b/test/ng/controllerSpec.js
index 567358a54e61..f872e42c3cb6 100644
--- a/test/ng/controllerSpec.js
+++ b/test/ng/controllerSpec.js
@@ -74,7 +74,7 @@ describe('$controller', function() {
it('should throw an exception if a controller is called "hasOwnProperty"', function() {
expect(function() {
$controllerProvider.register('hasOwnProperty', function($scope) {});
- }).toThrowMinErr('ng', 'badname', "hasOwnProperty is not a valid controller name");
+ }).toThrowMinErr('ng', 'badname', 'hasOwnProperty is not a valid controller name');
});
@@ -113,9 +113,9 @@ describe('$controller', function() {
it('should throw ctrlfmt if name contains spaces', function() {
expect(function() {
$controller('ctrl doom');
- }).toThrowMinErr("$controller", "ctrlfmt",
- "Badly formed controller string 'ctrl doom'. " +
- "Must match `__name__ as __id__` or `__name__`.");
+ }).toThrowMinErr('$controller', 'ctrlfmt',
+ 'Badly formed controller string \'ctrl doom\'. ' +
+ 'Must match `__name__ as __id__` or `__name__`.');
});
});
@@ -191,7 +191,7 @@ describe('$controller', function() {
expect(function() {
$controller('a.b.FooCtrl as foo');
- }).toThrowMinErr("$controller", "noscp", "Cannot export controller 'a.b.FooCtrl' as 'foo'! No $scope object provided via `locals`.");
+ }).toThrowMinErr('$controller', 'noscp', 'Cannot export controller \'a.b.FooCtrl\' as \'foo\'! No $scope object provided via `locals`.');
});
@@ -199,32 +199,32 @@ describe('$controller', function() {
it('should throw ctrlfmt if identifier contains non-ident characters', function() {
expect(function() {
$controller('ctrl as foo -1 ? cookie.substr(0, eqPos) : cookie;
var parts = path.split('/');
while (parts.length) {
- document.cookie = name + "=;path=" + (parts.join('/') || '/') + ";expires=Thu, 01 Jan 1970 00:00:00 GMT";
+ document.cookie = name + '=;path=' + (parts.join('/') || '/') + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';
parts.pop();
}
}
@@ -44,7 +44,7 @@ describe('$$cookieReader', function() {
it('should return a value for an existing cookie', function() {
- document.cookie = "foo=bar=baz;path=/";
+ document.cookie = 'foo=bar=baz;path=/';
expect($$cookieReader().foo).toEqual('bar=baz');
});
@@ -57,7 +57,7 @@ describe('$$cookieReader', function() {
});
it('should decode cookie values that were encoded by puts', function() {
- document.cookie = "cookie2%3Dbar%3Bbaz=val%3Due;path=/";
+ document.cookie = 'cookie2%3Dbar%3Bbaz=val%3Due;path=/';
expect($$cookieReader()['cookie2=bar;baz']).toEqual('val=ue');
});
@@ -84,8 +84,8 @@ describe('$$cookieReader', function() {
describe('getAll via $$cookieReader()', function() {
it('should return cookies as hash', function() {
- document.cookie = "foo1=bar1;path=/";
- document.cookie = "foo2=bar2;path=/";
+ document.cookie = 'foo1=bar1;path=/';
+ document.cookie = 'foo2=bar2;path=/';
expect($$cookieReader()).toEqual({'foo1':'bar1', 'foo2':'bar2'});
});
@@ -97,7 +97,7 @@ describe('$$cookieReader', function() {
it('should initialize cookie cache with existing cookies', function() {
- document.cookie = "existingCookie=existingValue;path=/";
+ document.cookie = 'existingCookie=existingValue;path=/';
expect($$cookieReader()).toEqual({'existingCookie':'existingValue'});
});
diff --git a/test/ng/directive/booleanAttrsSpec.js b/test/ng/directive/booleanAttrsSpec.js
index 38a91afa7336..ed74c6f99b21 100644
--- a/test/ng/directive/booleanAttrsSpec.js
+++ b/test/ng/directive/booleanAttrsSpec.js
@@ -152,9 +152,9 @@ describe('ngSrc', function() {
var element = $compile('
')($rootScope);
dealoc(element);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: some/{{id}}\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: some/{{id}}\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
}));
@@ -177,8 +177,8 @@ describe('ngSrc', function() {
});
element.attr('src');
}).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{id}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{id}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere');
}));
diff --git a/test/ng/directive/formSpec.js b/test/ng/directive/formSpec.js
index 7f9e30b56efc..f878c4826070 100644
--- a/test/ng/directive/formSpec.js
+++ b/test/ng/directive/formSpec.js
@@ -1118,7 +1118,7 @@ describe('form', function() {
it('should rename forms with no parent when interpolated name changes', function() {
var element = $compile('')(scope);
var element2 = $compile('
')(scope);
- scope.nameID = "A";
+ scope.nameID = 'A';
scope.$digest();
var form = element.controller('form');
var form2 = element2.controller('form');
@@ -1127,7 +1127,7 @@ describe('form', function() {
expect(form.$name).toBe('nameA');
expect(form2.$name).toBe('ngformA');
- scope.nameID = "B";
+ scope.nameID = 'B';
scope.$digest();
expect(scope.nameA).toBeUndefined();
expect(scope.ngformA).toBeUndefined();
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js
index 4082c366e0fb..d9546e063773 100644
--- a/test/ng/directive/inputSpec.js
+++ b/test/ng/directive/inputSpec.js
@@ -20,7 +20,7 @@ describe('input', function() {
it('should bind to a model', function() {
var inputElm = helper.compileInput(' ');
- $rootScope.$apply("name = 'misko'");
+ $rootScope.$apply('name = \'misko\'');
expect(inputElm.val()).toBe('misko');
});
@@ -33,8 +33,8 @@ describe('input', function() {
compare: function(actual, attributeName) {
var actualValue = actual.attr(attributeName);
var message = function() {
- return "Attribute '" + attributeName + "' expected to be off but was '" + actualValue +
- "' in: " + angular.mock.dump(actual);
+ return 'Attribute \'' + attributeName + '\' expected to be off but was \'' + actualValue +
+ '\' in: ' + angular.mock.dump(actual);
};
return {
@@ -134,7 +134,7 @@ describe('input', function() {
});
- describe("IE placeholder input events", function() {
+ describe('IE placeholder input events', function() {
//IE fires an input event whenever a placeholder visually changes, essentially treating it as a value
//Events:
// placeholder attribute change: *input*
@@ -191,7 +191,7 @@ describe('input', function() {
}
expect(inputElm).toBePristine();
- $rootScope.ph = "";
+ $rootScope.ph = '';
$rootScope.$digest();
if (msie) {
browserTrigger(inputElm, 'input');
@@ -236,7 +236,7 @@ describe('input', function() {
}
expect(inputElm).toBePristine();
- $rootScope.ph = "";
+ $rootScope.ph = '';
$rootScope.$digest();
if (msie) {
browserTrigger(inputElm, 'input');
@@ -350,11 +350,11 @@ describe('input', function() {
it('should rename form controls in form when interpolated name changes', function() {
- $rootScope.nameID = "A";
+ $rootScope.nameID = 'A';
var inputElm = helper.compileInput(' ');
expect($rootScope.form.nameA.$name).toBe('nameA');
var oldModel = $rootScope.form.nameA;
- $rootScope.nameID = "B";
+ $rootScope.nameID = 'B';
$rootScope.$digest();
expect($rootScope.form.nameA).toBeUndefined();
expect($rootScope.form.nameB).toBe(oldModel);
@@ -363,12 +363,12 @@ describe('input', function() {
it('should rename form controls in null form when interpolated name changes', function() {
- $rootScope.nameID = "A";
+ $rootScope.nameID = 'A';
var inputElm = helper.compileInput(' ');
var model = inputElm.controller('ngModel');
expect(model.$name).toBe('nameA');
- $rootScope.nameID = "B";
+ $rootScope.nameID = 'B';
$rootScope.$digest();
expect(model.$name).toBe('nameB');
});
@@ -509,7 +509,7 @@ describe('input', function() {
it('should allow complex reference binding', function() {
var inputElm = helper.compileInput(' ');
- $rootScope.$apply("obj = { abc: { name: 'Misko'} }");
+ $rootScope.$apply('obj = { abc: { name: \'Misko\'} }');
expect(inputElm.val()).toEqual('Misko');
});
@@ -528,11 +528,11 @@ describe('input', function() {
it('should report error on assignment error', function() {
expect(function() {
var inputElm = helper.compileInput(' ');
- }).toThrowMinErr("$parse", "syntax", "Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at [''].");
+ }).toThrowMinErr('$parse', 'syntax', 'Syntax Error: Token \'\'\'\' is an unexpected token at column 7 of the expression [throw \'\'] starting at [\'\'].');
});
- it("should render as blank if null", function() {
+ it('should render as blank if null', function() {
var inputElm = helper.compileInput(' ');
$rootScope.$apply('age = null');
@@ -661,7 +661,7 @@ describe('input', function() {
they('should use any timezone if specified in the options (format: $prop)',
{'+HHmm': '+0500', '+HH:mm': '+05:00'},
function(tz) {
- var ngModelOptions = "{timezone: '" + tz + "'}";
+ var ngModelOptions = '{timezone: \'' + tz + '\'}';
var inputElm = helper.compileInput(
' ');
@@ -926,7 +926,7 @@ describe('input', function() {
they('should use any timezone if specified in the options (format: $prop)',
{'+HHmm': '+0500', '+HH:mm': '+05:00'},
function(tz) {
- var ngModelOptions = "{timezone: '" + tz + "'}";
+ var ngModelOptions = '{timezone: \'' + tz + '\'}';
var inputElm = helper.compileInput(
' ');
@@ -1132,7 +1132,7 @@ describe('input', function() {
they('should use any timezone if specified in the options (format: $prop)',
{'+HHmm': '+0500', '+HH:mm': '+05:00'},
function(tz) {
- var ngModelOptions = "{timezone: '" + tz + "'}";
+ var ngModelOptions = '{timezone: \'' + tz + '\'}';
var inputElm = helper.compileInput(
' ');
@@ -1473,7 +1473,7 @@ describe('input', function() {
they('should use any timezone if specified in the options (format: $prop)',
{'+HHmm': '+0500', '+HH:mm': '+05:00'},
function(tz) {
- var ngModelOptions = "{timezone: '" + tz + "'}";
+ var ngModelOptions = '{timezone: \'' + tz + '\'}';
var inputElm = helper.compileInput(
' ');
@@ -1785,7 +1785,7 @@ describe('input', function() {
they('should use any timezone if specified in the options (format: $prop)',
{'+HHmm': '+0500', '+HH:mm': '+05:00'},
function(tz) {
- var ngModelOptions = "{timezone: '" + tz + "'}";
+ var ngModelOptions = '{timezone: \'' + tz + '\'}';
var inputElm = helper.compileInput(
' ');
@@ -2367,7 +2367,7 @@ describe('input', function() {
expect(function() {
$rootScope.value = 'one';
var inputElm = helper.compileInput(' ');
- }).toThrowMinErr('ngModel', 'numfmt', "Expected `one` to be a number");
+ }).toThrowMinErr('ngModel', 'numfmt', 'Expected `one` to be a number');
});
@@ -2375,62 +2375,62 @@ describe('input', function() {
var inputElm = helper.compileInput(' ');
// #.###e+##
- $rootScope.form.alias.$setViewValue("1.23214124123412412e+26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412e+26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e+26);
// #.###e##
- $rootScope.form.alias.$setViewValue("1.23214124123412412e26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412e26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e26);
// #.###e-##
- $rootScope.form.alias.$setViewValue("1.23214124123412412e-26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412e-26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e-26);
// ####e+##
- $rootScope.form.alias.$setViewValue("123214124123412412e+26");
+ $rootScope.form.alias.$setViewValue('123214124123412412e+26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e26);
// ####e##
- $rootScope.form.alias.$setViewValue("123214124123412412e26");
+ $rootScope.form.alias.$setViewValue('123214124123412412e26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e26);
// ####e-##
- $rootScope.form.alias.$setViewValue("123214124123412412e-26");
+ $rootScope.form.alias.$setViewValue('123214124123412412e-26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e-26);
// #.###E+##
- $rootScope.form.alias.$setViewValue("1.23214124123412412E+26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412E+26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e+26);
// #.###E##
- $rootScope.form.alias.$setViewValue("1.23214124123412412E26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412E26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e26);
// #.###E-##
- $rootScope.form.alias.$setViewValue("1.23214124123412412E-26");
+ $rootScope.form.alias.$setViewValue('1.23214124123412412E-26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(1.23214124123412412e-26);
// ####E+##
- $rootScope.form.alias.$setViewValue("123214124123412412E+26");
+ $rootScope.form.alias.$setViewValue('123214124123412412E+26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e26);
// ####E##
- $rootScope.form.alias.$setViewValue("123214124123412412E26");
+ $rootScope.form.alias.$setViewValue('123214124123412412E26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e26);
// ####E-##
- $rootScope.form.alias.$setViewValue("123214124123412412E-26");
+ $rootScope.form.alias.$setViewValue('123214124123412412E-26');
expect(inputElm).toBeValid();
expect($rootScope.value).toBe(123214124123412412e-26);
});
@@ -2646,7 +2646,7 @@ describe('input', function() {
it('should register required on non boolean elements', function() {
var inputElm = helper.compileInput('');
- $rootScope.$apply("value = ''");
+ $rootScope.$apply('value = \'\'');
expect(inputElm).toBeInvalid();
expect($rootScope.form.alias.$error.required).toBeTruthy();
@@ -2655,7 +2655,7 @@ describe('input', function() {
it('should not invalidate number if ng-required=false and viewValue has not been committed', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("required = false");
+ $rootScope.$apply('required = false');
expect(inputElm).toBeValid();
});
@@ -2687,7 +2687,7 @@ describe('input', function() {
it('should register required on non boolean elements', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("value = ''");
+ $rootScope.$apply('value = \'\'');
expect(inputElm).toBeInvalid();
expect($rootScope.form.numberInput.$error.required).toBeTruthy();
@@ -2733,7 +2733,7 @@ describe('input', function() {
it('should not register required on non boolean elements', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("value = ''");
+ $rootScope.$apply('value = \'\'');
expect(inputElm).toBeValid();
expect($rootScope.form.numberInput.$error.required).toBeFalsy();
@@ -3325,7 +3325,7 @@ describe('input', function() {
expect(EMAIL_REGEXP.test('a@$')).toBe(false);
expect(EMAIL_REGEXP.test('a@%')).toBe(false);
expect(EMAIL_REGEXP.test('a@&')).toBe(false);
- expect(EMAIL_REGEXP.test("a@'")).toBe(false);
+ expect(EMAIL_REGEXP.test('a@\'')).toBe(false);
expect(EMAIL_REGEXP.test('a@(')).toBe(false);
expect(EMAIL_REGEXP.test('a@)')).toBe(false);
expect(EMAIL_REGEXP.test('a@*')).toBe(false);
@@ -3362,13 +3362,13 @@ describe('input', function() {
expect(EMAIL_REGEXP.test('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxx')).toBe(false);
/* eslint-enable */
/* local-part valid characters and dot-atom syntax */
- expect(EMAIL_REGEXP.test("'@x")).toBe(true);
+ expect(EMAIL_REGEXP.test('\'@x')).toBe(true);
expect(EMAIL_REGEXP.test('-!#$%&*+/0123456789=?ABCDEFGHIJKLMNOPQRSTUVWXYZ@x')).toBe(true);
expect(EMAIL_REGEXP.test('^_`abcdefghijklmnopqrstuvwxyz{|}~@x')).toBe(true);
- expect(EMAIL_REGEXP.test(".@x")).toBe(false);
- expect(EMAIL_REGEXP.test("'.@x")).toBe(false);
- expect(EMAIL_REGEXP.test(".'@x")).toBe(false);
- expect(EMAIL_REGEXP.test("'.'@x")).toBe(true);
+ expect(EMAIL_REGEXP.test('.@x')).toBe(false);
+ expect(EMAIL_REGEXP.test('\'.@x')).toBe(false);
+ expect(EMAIL_REGEXP.test('.\'@x')).toBe(false);
+ expect(EMAIL_REGEXP.test('\'.\'@x')).toBe(true);
/* local-part invalid characters */
expect(EMAIL_REGEXP.test('@x')).toBe(false);
expect(EMAIL_REGEXP.test(' @x')).toBe(false);
@@ -3539,12 +3539,12 @@ describe('input', function() {
'
' +
'
');
- $rootScope.$apply("color = 'white'");
+ $rootScope.$apply('color = \'white\'');
expect(inputElm[0].checked).toBe(true);
expect(inputElm[1].checked).toBe(false);
expect(inputElm[2].checked).toBe(false);
- $rootScope.$apply("color = 'red'");
+ $rootScope.$apply('color = \'red\'');
expect(inputElm[0].checked).toBe(false);
expect(inputElm[1].checked).toBe(true);
expect(inputElm[2].checked).toBe(false);
@@ -3559,10 +3559,10 @@ describe('input', function() {
var inputElm = helper.compileInput(
'
');
- $rootScope.$apply("model = '0'");
+ $rootScope.$apply('model = \'0\'');
expect(inputElm[0].checked).toBe(true);
- $rootScope.$apply("model = 0");
+ $rootScope.$apply('model = 0');
expect(inputElm[0].checked).toBe(true);
});
@@ -3585,7 +3585,7 @@ describe('input', function() {
browserTrigger(inputElm[1], 'click');
expect($rootScope.value).toBe('red');
- $rootScope.$apply("other = 'non-red'");
+ $rootScope.$apply('other = \'non-red\'');
expect(inputElm[0].checked).toBe(false);
expect(inputElm[1].checked).toBe(false);
@@ -3621,19 +3621,19 @@ describe('input', function() {
browserTrigger(inputElm[4], 'click');
expect($rootScope.value).toBe(' blue ');
- $rootScope.$apply("value = ' opt2 '");
+ $rootScope.$apply('value = \' opt2 \'');
expect(inputElm[1].checked).toBe(false);
- $rootScope.$apply("value = 'opt2'");
+ $rootScope.$apply('value = \'opt2\'');
expect(inputElm[1].checked).toBe(true);
- $rootScope.$apply("value = ' opt3 '");
+ $rootScope.$apply('value = \' opt3 \'');
expect(inputElm[2].checked).toBe(true);
- $rootScope.$apply("value = 'opt3'");
+ $rootScope.$apply('value = \'opt3\'');
expect(inputElm[2].checked).toBe(false);
- $rootScope.$apply("value = 'blue'");
+ $rootScope.$apply('value = \'blue\'');
expect(inputElm[3].checked).toBe(true);
expect(inputElm[4].checked).toBe(false);
- $rootScope.$apply("value = ' blue '");
+ $rootScope.$apply('value = \' blue \'');
expect(inputElm[3].checked).toBe(false);
expect(inputElm[4].checked).toBe(true);
});
@@ -3656,10 +3656,10 @@ describe('input', function() {
it('should format booleans', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("name = false");
+ $rootScope.$apply('name = false');
expect(inputElm[0].checked).toBe(false);
- $rootScope.$apply("name = true");
+ $rootScope.$apply('name = true');
expect(inputElm[0].checked).toBe(true);
});
@@ -3679,13 +3679,13 @@ describe('input', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("name = 'y'");
+ $rootScope.$apply('name = \'y\'');
expect(inputElm[0].checked).toBe(true);
- $rootScope.$apply("name = 'n'");
+ $rootScope.$apply('name = \'n\'');
expect(inputElm[0].checked).toBe(false);
- $rootScope.$apply("name = 'something else'");
+ $rootScope.$apply('name = \'something else\'');
expect(inputElm[0].checked).toBe(false);
browserTrigger(inputElm, 'click');
@@ -3699,14 +3699,14 @@ describe('input', function() {
it('should throw if ngTrueValue is present and not a constant expression', function() {
expect(function() {
var inputElm = helper.compileInput('
');
- }).toThrowMinErr('ngModel', 'constexpr', "Expected constant expression for `ngTrueValue`, but saw `yes`.");
+ }).toThrowMinErr('ngModel', 'constexpr', 'Expected constant expression for `ngTrueValue`, but saw `yes`.');
});
it('should throw if ngFalseValue is present and not a constant expression', function() {
expect(function() {
var inputElm = helper.compileInput('
');
- }).toThrowMinErr('ngModel', 'constexpr', "Expected constant expression for `ngFalseValue`, but saw `no`.");
+ }).toThrowMinErr('ngModel', 'constexpr', 'Expected constant expression for `ngFalseValue`, but saw `no`.');
});
@@ -3747,10 +3747,10 @@ describe('input', function() {
describe('textarea', function() {
- it("should process textarea", function() {
+ it('should process textarea', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("name = 'Adam'");
+ $rootScope.$apply('name = \'Adam\'');
expect(inputElm.val()).toEqual('Adam');
helper.changeInputValueTo('Shyam');
@@ -3778,7 +3778,7 @@ describe('input', function() {
it('should update the dom "value" property and attribute', function() {
var inputElm = helper.compileInput('
');
- $rootScope.$apply("value = 'something'");
+ $rootScope.$apply('value = \'something\'');
expect(inputElm[0].value).toBe('something');
expect(inputElm[0].getAttribute('value')).toBe('something');
diff --git a/test/ng/directive/ngBindSpec.js b/test/ng/directive/ngBindSpec.js
index 424d5cd758fb..b4e80b2f62d5 100644
--- a/test/ng/directive/ngBindSpec.js
+++ b/test/ng/directive/ngBindSpec.js
@@ -163,7 +163,7 @@ describe('ngBind*', function() {
expect(function() {
$compile('
');
}).toThrowMinErr('$parse', 'syntax',
- "Syntax Error: Token '{' invalid key at column 2 of the expression [{{myHtml}}] starting at [{myHtml}}]");
+ 'Syntax Error: Token \'{\' invalid key at column 2 of the expression [{{myHtml}}] starting at [{myHtml}}]');
}));
diff --git a/test/ng/directive/ngClassSpec.js b/test/ng/directive/ngClassSpec.js
index f592a39bd313..b30d1318317c 100644
--- a/test/ng/directive/ngClassSpec.js
+++ b/test/ng/directive/ngClassSpec.js
@@ -244,7 +244,7 @@ describe('ngClass', function() {
}));
- it("should allow ngClassOdd/Even on the same element with overlapping classes", inject(function($rootScope, $compile, $animate) {
+ it('should allow ngClassOdd/Even on the same element with overlapping classes', inject(function($rootScope, $compile, $animate) {
var className;
element = $compile('
')($rootScope);
@@ -304,7 +304,7 @@ describe('ngClass', function() {
element = $compile('
')($rootScope);
$rootScope.$apply(function() {
- $rootScope.cls = "two";
+ $rootScope.cls = 'two';
$rootScope.four = true;
});
expect(element).toHaveClass('one');
@@ -313,7 +313,7 @@ describe('ngClass', function() {
expect(element).toHaveClass('four');
$rootScope.$apply(function() {
- $rootScope.cls = "too";
+ $rootScope.cls = 'too';
});
expect(element).toHaveClass('one');
expect(element).toHaveClass('too'); // interpolated
@@ -322,7 +322,7 @@ describe('ngClass', function() {
expect(element.hasClass('two')).toBeFalsy();
$rootScope.$apply(function() {
- $rootScope.cls = "to";
+ $rootScope.cls = 'to';
});
expect(element).toHaveClass('one');
expect(element).toHaveClass('to'); // interpolated
@@ -335,7 +335,7 @@ describe('ngClass', function() {
it('should not mess up class value due to observing an interpolated class attribute', inject(function($rootScope, $compile) {
$rootScope.foo = true;
- $rootScope.$watch("anything", function() {
+ $rootScope.$watch('anything', function() {
$rootScope.foo = false;
});
element = $compile('
')($rootScope);
@@ -433,7 +433,7 @@ describe('ngClass animations', function() {
dealoc(element);
});
- it("should avoid calling addClass accidentally when removeClass is going on", function() {
+ it('should avoid calling addClass accidentally when removeClass is going on', function() {
module('ngAnimateMock');
inject(function($compile, $rootScope, $animate, $timeout) {
element = angular.element('
');
@@ -466,7 +466,7 @@ describe('ngClass animations', function() {
});
});
- it("should combine the ngClass evaluation with the enter animation", function() {
+ it('should combine the ngClass evaluation with the enter animation', function() {
//mocks are not used since the enter delegation method is called before addClass and
//it makes it impossible to test to see that addClass is called first
@@ -512,7 +512,7 @@ describe('ngClass animations', function() {
});
});
- it("should not remove classes if they're going to be added back right after", function() {
+ it('should not remove classes if they\'re going to be added back right after', function() {
module('ngAnimateMock');
inject(function($rootScope, $compile, $animate) {
diff --git a/test/ng/directive/ngIncludeSpec.js b/test/ng/directive/ngIncludeSpec.js
index 5cd272c63bd7..c87cb5e4e32d 100644
--- a/test/ng/directive/ngIncludeSpec.js
+++ b/test/ng/directive/ngIncludeSpec.js
@@ -268,7 +268,7 @@ describe('ngInclude', function() {
it('should discard pending xhr callbacks if a new template is requested before the current ' +
'finished loading', inject(function($rootScope, $compile, $httpBackend) {
- element = jqLite("
");
+ element = jqLite('
');
var log = {};
$rootScope.templateUrl = 'myUrl1';
@@ -539,7 +539,7 @@ describe('ngInclude', function() {
function($rootScope, $animate, $timeout) {
expect(autoScrollSpy).not.toHaveBeenCalled();
- $rootScope.$apply("tpl = 'template.html'");
+ $rootScope.$apply('tpl = \'template.html\'');
expect($animate.queue.shift().event).toBe('enter');
$animate.flush();
@@ -591,7 +591,7 @@ describe('ngInclude and transcludes', function() {
});
});
- it("should compile its content correctly (although we remove it later)", function() {
+ it('should compile its content correctly (although we remove it later)', function() {
var testElement;
module(function() {
directive('test', function() {
diff --git a/test/ng/directive/ngInitSpec.js b/test/ng/directive/ngInitSpec.js
index 9ed930ad39eb..60cab60e69a4 100644
--- a/test/ng/directive/ngInitSpec.js
+++ b/test/ng/directive/ngInitSpec.js
@@ -9,13 +9,13 @@ describe('ngInit', function() {
});
- it("should init model", inject(function($rootScope, $compile) {
+ it('should init model', inject(function($rootScope, $compile) {
element = $compile('
')($rootScope);
expect($rootScope.a).toEqual(123);
}));
- it("should be evaluated before ngInclude", inject(function($rootScope, $templateCache, $compile) {
+ it('should be evaluated before ngInclude', inject(function($rootScope, $templateCache, $compile) {
$templateCache.put('template1.tpl', '1 ');
$templateCache.put('template2.tpl', '2 ');
$rootScope.template = 'template1.tpl';
@@ -27,7 +27,7 @@ describe('ngInit', function() {
}));
- it("should be evaluated after ngController", function() {
+ it('should be evaluated after ngController', function() {
module(function($controllerProvider) {
$controllerProvider.register('TestCtrl', function($scope) {});
});
diff --git a/test/ng/directive/ngListSpec.js b/test/ng/directive/ngListSpec.js
index 2220a214b76b..3ea606978345 100644
--- a/test/ng/directive/ngListSpec.js
+++ b/test/ng/directive/ngListSpec.js
@@ -16,7 +16,7 @@ describe('ngList', function() {
var inputElm = helper.compileInput(' ');
// model -> view
- $rootScope.$apply("list = ['x', 'y', 'z']");
+ $rootScope.$apply('list = [\'x\', \'y\', \'z\']');
expect(inputElm.val()).toBe('x, y, z');
// view -> model
@@ -25,7 +25,7 @@ describe('ngList', function() {
});
- it("should not clobber text if model changes due to itself", function() {
+ it('should not clobber text if model changes due to itself', function() {
// When the user types 'a,b' the 'a,' stage parses to ['a'] but if the
// $parseModel function runs it will change to 'a', in essence preventing
// the user from ever typing ','.
@@ -79,7 +79,7 @@ describe('ngList', function() {
});
- it("should join the list back together with the custom separator", function() {
+ it('should join the list back together with the custom separator', function() {
var inputElm = helper.compileInput(' ');
$rootScope.$apply(function() {
@@ -119,13 +119,13 @@ describe('ngList', function() {
});
- it("should not trim whitespace from each list item", function() {
+ it('should not trim whitespace from each list item', function() {
helper.compileInput(' ');
helper.changeInputValueTo('a | b');
expect($rootScope.list).toEqual(['a ',' b']);
});
- it("should support splitting on newlines", function() {
+ it('should support splitting on newlines', function() {
helper.compileInput('');
helper.changeInputValueTo('a\nb');
expect($rootScope.list).toEqual(['a','b']);
diff --git a/test/ng/directive/ngModelSpec.js b/test/ng/directive/ngModelSpec.js
index c2609de43722..b6ada0d73d2a 100644
--- a/test/ng/directive/ngModelSpec.js
+++ b/test/ng/directive/ngModelSpec.js
@@ -906,8 +906,8 @@ describe('ngModel', function() {
expect(function() {
scope.$apply('value = "123"');
- }).toThrowMinErr("ngModel", "nopromise",
- "Expected asynchronous validator to return a promise but got 'true' instead.");
+ }).toThrowMinErr('ngModel', 'nopromise',
+ 'Expected asynchronous validator to return a promise but got \'true\' instead.');
}));
@@ -1362,7 +1362,7 @@ describe('ngModel', function() {
expect(element.hasClass('ng-valid-email')).toBe(true);
expect(element.hasClass('ng-invalid-email')).toBe(false);
- $rootScope.$apply("value = 'invalid-email'");
+ $rootScope.$apply('value = \'invalid-email\'');
expect(element).toBeInvalid();
expect(element).toBePristine();
expect(element.hasClass('ng-valid-email')).toBe(false);
@@ -1922,7 +1922,7 @@ describe('ngModelOptions attributes', function() {
'ng-model-options="{ updateOn: \'blur\'}"' +
'/>');
- $rootScope.$apply("color = 'white'");
+ $rootScope.$apply('color = \'white\'');
browserTrigger(inputElm[2], 'click');
expect($rootScope.color).toBe('white');
@@ -1944,7 +1944,7 @@ describe('ngModelOptions attributes', function() {
'ng-model-options="{ updateOn: \'blur default\' }"' +
'/>');
- $rootScope.$apply("color = 'white'");
+ $rootScope.$apply('color = \'white\'');
browserTrigger(inputElm[2], 'click');
expect($rootScope.color).toBe('blue');
});
@@ -2187,7 +2187,7 @@ describe('ngModelOptions attributes', function() {
'ng-model-options="{ updateOn: \'blur\' }" />');
helper.changeInputValueTo('a');
- $rootScope.$apply("name = 'b'");
+ $rootScope.$apply('name = \'b\'');
browserTrigger(inputElm, 'blur');
expect($rootScope.name).toBe('b');
});
diff --git a/test/ng/directive/ngNonBindableSpec.js b/test/ng/directive/ngNonBindableSpec.js
index e69e633e672c..55e022ee81e3 100644
--- a/test/ng/directive/ngNonBindableSpec.js
+++ b/test/ng/directive/ngNonBindableSpec.js
@@ -22,17 +22,17 @@ describe('ngNonBindable', function() {
' {{a}} ' +
' ' +
' ')($rootScope);
- $rootScope.a = "one";
- $rootScope.b = "two";
+ $rootScope.a = 'one';
+ $rootScope.b = 'two';
$rootScope.$digest();
// Bindings not contained by ng-non-bindable should resolve.
- var spans = element.find("span");
+ var spans = element.find('span');
expect(spans.eq(0).text()).toEqual('one');
expect(spans.eq(1).text()).toEqual('two');
expect(spans.eq(3).text()).toEqual('one');
expect(spans.eq(4).text()).toEqual('two');
// Bindings contained by ng-non-bindable should be left alone.
- var nonBindableDiv = element.find("div");
+ var nonBindableDiv = element.find('div');
expect(nonBindableDiv.attr('foo')).toEqual('{{a}}');
expect(trim(nonBindableDiv.text())).toEqual('{{b}}');
}));
diff --git a/test/ng/directive/ngOptionsSpec.js b/test/ng/directive/ngOptionsSpec.js
index d16c586516b9..376b77a7e44e 100644
--- a/test/ng/directive/ngOptionsSpec.js
+++ b/test/ng/directive/ngOptionsSpec.js
@@ -171,7 +171,7 @@ describe('ngOptions', function() {
$compileProvider
.directive('customSelect', function() {
return {
- restrict: "E",
+ restrict: 'E',
replace: true,
scope: {
ngModel: '=',
diff --git a/test/ng/directive/ngPluralizeSpec.js b/test/ng/directive/ngPluralizeSpec.js
index 6f913ccc615c..d64f72b3ce44 100644
--- a/test/ng/directive/ngPluralizeSpec.js
+++ b/test/ng/directive/ngPluralizeSpec.js
@@ -15,17 +15,17 @@ describe('ngPluralize', function() {
beforeEach(inject(function($rootScope, $compile) {
element = $compile(
'
" +
+ 'when="{\'-1\': \'You have negative email. Whohoo!\',' +
+ '\'0\': \'You have no new email\',' +
+ '\'one\': \'You have one new email\',' +
+ '\'other\': \'You have {} new emails\'}">' +
' ')($rootScope);
elementAlt = $compile(
'
" +
+ 'when-minus-1=\'You have negative email. Whohoo!\' ' +
+ 'when-0=\'You have no new email\' ' +
+ 'when-one=\'You have one new email\' ' +
+ 'when-other=\'You have {} new emails\'>' +
' ')($rootScope);
}));
@@ -90,14 +90,14 @@ describe('ngPluralize', function() {
expect(element.text()).toBe('');
expect(elementAlt.text()).toBe('');
expect($log.debug.logs.shift()).toEqual([
- "ngPluralize: no rule defined for 'NaN' in {" +
- "'-1': 'You have negative email. Whohoo!'," +
- "'0': 'You have no new email'," +
- "'one': 'You have one new email'," +
- "'other': 'You have {} new emails'}"
+ 'ngPluralize: no rule defined for \'NaN\' in {' +
+ '\'-1\': \'You have negative email. Whohoo!\',' +
+ '\'0\': \'You have no new email\',' +
+ '\'one\': \'You have one new email\',' +
+ '\'other\': \'You have {} new emails\'}'
]);
expect($log.debug.logs.shift()).toEqual([
- "ngPluralize: no rule defined for 'NaN' in undefined"
+ 'ngPluralize: no rule defined for \'NaN\' in undefined'
]);
$rootScope.email = null;
@@ -148,9 +148,9 @@ describe('ngPluralize', function() {
it('should be able to handle empty strings as possible values', inject(function($rootScope, $compile) {
element = $compile(
'
" +
+ 'when="{\'0\': \'\',' +
+ '\'one\': \'Some text\',' +
+ '\'other\': \'Some text\'}">' +
' ')($rootScope);
$rootScope.email = '0';
$rootScope.$digest();
@@ -161,10 +161,10 @@ describe('ngPluralize', function() {
function($compile, $rootScope) {
element = $compile(
'
" +
+ 'when="{\'NaN\': \'Unspecified email count\',' +
+ '\'0\': \'\',' +
+ '\'one\': \'Some text\',' +
+ '\'other\': \'Some text\'}">' +
' ')($rootScope);
$rootScope.email = '0';
@@ -199,29 +199,29 @@ describe('ngPluralize', function() {
inject(function($rootScope, $compile) {
element = $compile(
'
" +
+ 'when="{\'0\': \'Zero\',' +
+ '\'one\': \'Some text\',' +
+ '\'other\': \'Some text\'}">' +
' ')($rootScope);
- $locale.pluralCat = function() {return "few";};
+ $locale.pluralCat = function() {return 'few';};
$rootScope.email = '3';
expect($log.debug.logs).toEqual([]);
$rootScope.$digest();
expect(element.text()).toBe('');
expect($log.debug.logs.shift())
- .toEqual(["ngPluralize: no rule defined for 'few' in {'0': 'Zero','one': 'Some text','other': 'Some text'}"]);
+ .toEqual(['ngPluralize: no rule defined for \'few\' in {\'0\': \'Zero\',\'one\': \'Some text\',\'other\': \'Some text\'}']);
}));
it('should empty the element content when using a rule that is not defined',
inject(function($rootScope, $compile) {
element = $compile(
'
" +
+ 'when="{\'0\': \'Zero\',' +
+ '\'one\': \'Some text\',' +
+ '\'other\': \'Some text\'}">' +
' ')($rootScope);
- $locale.pluralCat = function(count) {return count === 1 ? "one" : "few";};
+ $locale.pluralCat = function(count) {return count === 1 ? 'one' : 'few';};
$rootScope.email = '0';
$rootScope.$digest();
@@ -244,21 +244,21 @@ describe('ngPluralize', function() {
describe('deal with pluralized strings with offset', function() {
it('should show single/plural strings with offset', inject(function($rootScope, $compile) {
element = $compile(
- "
" +
- " ")($rootScope);
+ '
' +
+ ' ')($rootScope);
elementAlt = $compile(
- "
" +
- " ")($rootScope);
+ '
' +
+ ' ')($rootScope);
$rootScope.p1 = 'Igor';
$rootScope.p2 = 'Misko';
@@ -304,19 +304,19 @@ describe('ngPluralize', function() {
inject(function($compile, $rootScope) {
element = $compile(
- "
" +
- " ")($rootScope);
+ '
' +
+ ' ')($rootScope);
elementAlt = $compile(
- "
" +
- " ")($rootScope);
+ '
' +
+ ' ')($rootScope);
$rootScope.p1 = 'Igor';
$rootScope.viewCount = 0;
@@ -348,13 +348,13 @@ describe('ngPluralize', function() {
inject(function($compile, $rootScope) {
element = $compile(
'
" +
+ 'when="{\'one\': \'You have one new email\',' +
+ '\'other\': \'You have {} new emails\'}">' +
' ')($rootScope);
elementAlt = $compile(
'
" +
+ 'when-one=\'You have one new email\' ' +
+ 'when-other=\'You have {} new emails\'>' +
' ')($rootScope);
$rootScope.email = undefined;
@@ -389,13 +389,13 @@ describe('ngPluralize', function() {
inject(function($compile, $rootScope) {
element = $compile(
'
" +
+ 'when="{\'one\': \'You, {{user}}, have one new email\',' +
+ '\'other\': \'You, {{user}}, have {} new emails\'}">' +
' ')($rootScope);
elementAlt = $compile(
'
" +
+ 'when-one=\'You, {{user}}, have one new email\' ' +
+ 'when-other=\'You, {{user}}, have {} new emails\'>' +
' ')($rootScope);
$rootScope.user = 'Lucas';
diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js
index bb7ed2b950e5..71e5287a5233 100644
--- a/test/ng/directive/ngRepeatSpec.js
+++ b/test/ng/directive/ngRepeatSpec.js
@@ -37,7 +37,7 @@ describe('ngRepeat', function() {
'')(scope);
// eslint-disable-next-line no-extend-native
- Array.prototype.extraProperty = "should be ignored";
+ Array.prototype.extraProperty = 'should be ignored';
// INIT
scope.items = [{name: 'misko'}, {name:'shyam'}];
scope.$digest();
@@ -102,11 +102,11 @@ describe('ngRepeat', function() {
'
{{item.name}}; ' +
'')(scope);
- window.document.body.innerHTML = "
" +
- "a " +
- "b " +
- "c " +
- "
";
+ window.document.body.innerHTML = '
' +
+ 'a ' +
+ 'b ' +
+ 'c ' +
+ '
';
var htmlCollection = window.document.getElementsByTagName('a');
scope.items = htmlCollection;
@@ -122,9 +122,9 @@ describe('ngRepeat', function() {
Collection.prototype.length = 0;
var collection = new Collection();
- collection.push({ name: "x" });
- collection.push({ name: "y" });
- collection.push({ name: "z" });
+ collection.push({ name: 'x' });
+ collection.push({ name: 'y' });
+ collection.push({ name: 'z' });
element = $compile(
'
' +
@@ -162,7 +162,7 @@ describe('ngRepeat', function() {
'' +
'{{key}}:{{value}}| ' +
' ')(scope);
- scope.items = {age:20, wealth:20, prodname: "Bingo", dogname: "Bingo", codename: "20"};
+ scope.items = {age:20, wealth:20, prodname: 'Bingo', dogname: 'Bingo', codename: '20'};
scope.$digest();
expect(element.text()).toEqual('age:20|wealth:20|prodname:Bingo|dogname:Bingo|codename:20|');
});
@@ -277,7 +277,7 @@ describe('ngRepeat', function() {
' ')(scope);
// eslint-disable-next-line no-extend-native
- Array.prototype.extraProperty = "should be ignored";
+ Array.prototype.extraProperty = 'should be ignored';
// INIT
scope.items = [true, true, true];
scope.$digest();
@@ -523,7 +523,7 @@ describe('ngRepeat', function() {
});
function escape(text) {
- return text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ return text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
}
}));
});
@@ -585,7 +585,7 @@ describe('ngRepeat', function() {
});
- it("should throw error when left-hand-side of ngRepeat can't be parsed", function() {
+ it('should throw error when left-hand-side of ngRepeat can\'t be parsed', function() {
element = jqLite('
');
$compile(element)(scope);
expect($exceptionHandler.errors.shift()[0].message).
diff --git a/test/ng/directive/ngSrcSpec.js b/test/ng/directive/ngSrcSpec.js
index 762e9339faf0..6c971a0b0419 100644
--- a/test/ng/directive/ngSrcSpec.js
+++ b/test/ng/directive/ngSrcSpec.js
@@ -29,41 +29,41 @@ describe('ngSrc', function() {
describe('iframe[ng-src]', function() {
it('should pass through src attributes for the same domain', inject(function($compile, $rootScope) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = "different_page";
+ $rootScope.testUrl = 'different_page';
$rootScope.$apply();
expect(element.attr('src')).toEqual('different_page');
}));
it('should error on src attributes for a different domain', inject(function($compile, $rootScope) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = "http://a.different.domain.example.com";
+ $rootScope.testUrl = 'http://a.different.domain.example.com';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "http://a.different.domain.example.com");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'http://a.different.domain.example.com');
}));
it('should error on JS src attributes', inject(function($compile, $rootScope) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = "javascript:alert(1);";
+ $rootScope.testUrl = 'javascript:alert(1);';
expect(function() { $rootScope.$apply(); }).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "javascript:alert(1);");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'javascript:alert(1);');
}));
it('should error on non-resource_url src attributes', inject(function($compile, $rootScope, $sce) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsUrl('javascript:doTrustedStuff()');
expect($rootScope.$apply).toThrowMinErr(
- "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " +
- "loading resource from url not allowed by $sceDelegate policy. URL: " +
- "javascript:doTrustedStuff()");
+ '$interpolate', 'interr', 'Can\'t interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked ' +
+ 'loading resource from url not allowed by $sceDelegate policy. URL: ' +
+ 'javascript:doTrustedStuff()');
}));
it('should pass through $sce.trustAs() values in src attributes', inject(function($compile, $rootScope, $sce) {
element = $compile('
')($rootScope);
- $rootScope.testUrl = $sce.trustAsResourceUrl("javascript:doTrustedStuff()");
+ $rootScope.testUrl = $sce.trustAsResourceUrl('javascript:doTrustedStuff()');
$rootScope.$apply();
expect(element.attr('src')).toEqual('javascript:doTrustedStuff()');
diff --git a/test/ng/directive/ngSwitchSpec.js b/test/ng/directive/ngSwitchSpec.js
index ac94ab29e6e3..cebb52b849cf 100644
--- a/test/ng/directive/ngSwitchSpec.js
+++ b/test/ng/directive/ngSwitchSpec.js
@@ -21,7 +21,7 @@ describe('ngSwitch', function() {
$rootScope.select = 1;
$rootScope.$apply();
expect(element.text()).toEqual('first:');
- $rootScope.name = "shyam";
+ $rootScope.name = 'shyam';
$rootScope.$apply();
expect(element.text()).toEqual('first:shyam');
$rootScope.select = 2;
@@ -51,7 +51,7 @@ describe('ngSwitch', function() {
$rootScope.select = 1;
$rootScope.$apply();
expect(element.text()).toEqual('first:, first too:');
- $rootScope.name = "shyam";
+ $rootScope.name = 'shyam';
$rootScope.$apply();
expect(element.text()).toEqual('first:shyam, first too:shyam');
$rootScope.select = 2;
@@ -238,7 +238,7 @@ describe('ngSwitch', function() {
}));
- it("should interoperate with other transclusion directives like ngRepeat", inject(function($rootScope, $compile) {
+ it('should interoperate with other transclusion directives like ngRepeat', inject(function($rootScope, $compile) {
element = $compile(
'
' +
'
{{value}}:{{foo}}|
' +
diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js
index 3be1afd2dc18..0c0ce38bfcb1 100644
--- a/test/ng/directive/selectSpec.js
+++ b/test/ng/directive/selectSpec.js
@@ -281,11 +281,11 @@ describe('select', function() {
it('should rename select controls in form when interpolated name changes', function() {
- scope.nameID = "A";
+ scope.nameID = 'A';
compile('
');
expect(scope.form.nameA.$name).toBe('nameA');
var oldModel = scope.form.nameA;
- scope.nameID = "B";
+ scope.nameID = 'B';
scope.$digest();
expect(scope.form.nameA).toBeUndefined();
expect(scope.form.nameB).toBe(oldModel);
@@ -463,7 +463,7 @@ describe('select', function() {
'
robot x ' +
'
robot y ' +
'');
- expect(element).toEqualSelect(["? undefined:undefined ?"], "--select--", 'x', 'y');
+ expect(element).toEqualSelect(['? undefined:undefined ?'], '--select--', 'x', 'y');
});
@@ -473,7 +473,7 @@ describe('select', function() {
'
robot x ' +
'
robot y ' +
'');
- expect(element).toEqualSelect(["? undefined:undefined ?"], "--select--", 'x', 'y');
+ expect(element).toEqualSelect(['? undefined:undefined ?'], '--select--', 'x', 'y');
});
@@ -528,7 +528,7 @@ describe('select', function() {
describe('unknown option', function() {
- it("should insert&select temporary unknown option when no options-model match", function() {
+ it('should insert&select temporary unknown option when no options-model match', function() {
compile('
' +
'c3p0 ' +
'r2d2 ' +
@@ -543,14 +543,14 @@ describe('select', function() {
scope.$apply(function() {
- scope.robot = "wallee";
+ scope.robot = 'wallee';
});
expect(element).toEqualSelect([unknownValue('wallee')], 'c3p0', 'r2d2');
});
- it("should NOT insert temporary unknown option when model is undefined and empty options " +
- "is present", function() {
+ it('should NOT insert temporary unknown option when model is undefined and empty options ' +
+ 'is present', function() {
compile('' +
'--select-- ' +
'c3p0 ' +
@@ -577,8 +577,8 @@ describe('select', function() {
});
- it("should insert&select temporary unknown option when no options-model match, empty " +
- "option is present and model is defined", function() {
+ it('should insert&select temporary unknown option when no options-model match, empty ' +
+ 'option is present and model is defined', function() {
scope.robot = 'wallee';
compile('' +
'--select-- ' +
@@ -1259,7 +1259,7 @@ describe('select', function() {
}));
it('should throw an exception if an option value interpolates to "hasOwnProperty"', function() {
- scope.hasOwnPropertyOption = "hasOwnProperty";
+ scope.hasOwnPropertyOption = 'hasOwnProperty';
expect(function() {
compile('' +
'{{hasOwnPropertyOption}} ' +
diff --git a/test/ng/directive/validatorsSpec.js b/test/ng/directive/validatorsSpec.js
index e7a0a13198d6..b598cfe50dc0 100644
--- a/test/ng/directive/validatorsSpec.js
+++ b/test/ng/directive/validatorsSpec.js
@@ -135,7 +135,7 @@ describe('validators', function() {
it('should not throw an error when scope pattern can\'t be found', function() {
expect(function() {
var inputElm = helper.compileInput(' ');
- $rootScope.$apply("foo = 'bar'");
+ $rootScope.$apply('foo = \'bar\'');
}).not.toThrowError(/^\[ngPattern:noregexp\] Expected fooRegexp to be a RegExp but was/);
});
@@ -508,22 +508,22 @@ describe('validators', function() {
it('should allow bindings via ngRequired', function() {
var inputElm = helper.compileInput(' ');
- $rootScope.$apply("required = false");
+ $rootScope.$apply('required = false');
helper.changeInputValueTo('');
expect(inputElm).toBeValid();
- $rootScope.$apply("required = true");
+ $rootScope.$apply('required = true');
expect(inputElm).toBeInvalid();
- $rootScope.$apply("value = 'some'");
+ $rootScope.$apply('value = \'some\'');
expect(inputElm).toBeValid();
helper.changeInputValueTo('');
expect(inputElm).toBeInvalid();
- $rootScope.$apply("required = false");
+ $rootScope.$apply('required = false');
expect(inputElm).toBeValid();
});
@@ -540,7 +540,7 @@ describe('validators', function() {
it('should be $invalid but $pristine if not touched', function() {
var inputElm = helper.compileInput(' ');
- $rootScope.$apply("name = null");
+ $rootScope.$apply('name = null');
expect(inputElm).toBeInvalid();
expect(inputElm).toBePristine();
@@ -587,10 +587,10 @@ describe('validators', function() {
$rootScope.$apply();
expect(inputElm).toBeInvalid();
- $rootScope.$apply("answer = true");
+ $rootScope.$apply('answer = true');
expect(inputElm).toBeValid();
- $rootScope.$apply("answer = false");
+ $rootScope.$apply('answer = false');
expect(inputElm).toBeValid();
});
diff --git a/test/ng/documentSpec.js b/test/ng/documentSpec.js
index 3fe65150e876..cf86ca85cd3f 100644
--- a/test/ng/documentSpec.js
+++ b/test/ng/documentSpec.js
@@ -3,7 +3,7 @@
describe('$document', function() {
- it("should inject $document", inject(function($document) {
+ it('should inject $document', inject(function($document) {
expect($document).toEqual(jqLite(window.document));
}));
diff --git a/test/ng/filter/filterSpec.js b/test/ng/filter/filterSpec.js
index 0136cd76e47c..ff3a77e7e150 100644
--- a/test/ng/filter/filterSpec.js
+++ b/test/ng/filter/filterSpec.js
@@ -25,7 +25,7 @@ describe('Filter: filter', function() {
expect(filter(items, '34').length).toBe(1);
expect(filter(items, '34')[0]).toBe(1234);
- expect(filter(items, "I don't exist").length).toBe(0);
+ expect(filter(items, 'I don\'t exist').length).toBe(0);
});
@@ -452,9 +452,9 @@ describe('Filter: filter', function() {
}
var argsObj = getArguments({name: 'Misko'}, {name: 'Igor'}, {name: 'Brad'});
- var nodeList = jqLite("Misko Igor Brad
")[0].childNodes;
+ var nodeList = jqLite('Misko Igor Brad
')[0].childNodes;
function nodeFilterPredicate(node) {
- return node.innerHTML.indexOf("I") !== -1;
+ return node.innerHTML.indexOf('I') !== -1;
}
expect(filter(argsObj, 'i').length).toBe(2);
diff --git a/test/ng/filter/filtersSpec.js b/test/ng/filter/filtersSpec.js
index 42e39d40830d..bdd9b81a2417 100644
--- a/test/ng/filter/filtersSpec.js
+++ b/test/ng/filter/filtersSpec.js
@@ -79,11 +79,11 @@ describe('filters', function() {
});
it('should format the same with string as well as numeric fractionSize', function() {
- var num = formatNumber(123.1, pattern, ',', '.', "0");
+ var num = formatNumber(123.1, pattern, ',', '.', '0');
expect(num).toBe('123');
num = formatNumber(123.1, pattern, ',', '.', 0);
expect(num).toBe('123');
- num = formatNumber(123.1, pattern, ',', '.', "3");
+ num = formatNumber(123.1, pattern, ',', '.', '3');
expect(num).toBe('123.100');
num = formatNumber(123.1, pattern, ',', '.', 3);
expect(num).toBe('123.100');
@@ -160,8 +160,8 @@ describe('filters', function() {
it('should do basic currency filtering', function() {
expect(currency(0)).toEqual('$0.00');
expect(currency(-999)).toEqual('-$999.00');
- expect(currency(1234.5678, "USD$")).toEqual('USD$1,234.57');
- expect(currency(1234.5678, "USD$", 0)).toEqual('USD$1,235');
+ expect(currency(1234.5678, 'USD$')).toEqual('USD$1,234.57');
+ expect(currency(1234.5678, 'USD$', 0)).toEqual('USD$1,235');
});
it('should pass through null and undefined to be compatible with one-time binding', function() {
@@ -209,30 +209,30 @@ describe('filters', function() {
expect(number([])).toEqual('');
expect(number(+Infinity)).toEqual('∞');
expect(number(-Infinity)).toEqual('-∞');
- expect(number("1234.5678")).toEqual('1,234.568');
+ expect(number('1234.5678')).toEqual('1,234.568');
expect(number(1 / 0)).toEqual('∞');
- expect(number(1, 2)).toEqual("1.00");
- expect(number(.1, 2)).toEqual("0.10");
- expect(number(.01, 2)).toEqual("0.01");
- expect(number(.001, 3)).toEqual("0.001");
- expect(number(.0001, 3)).toEqual("0.000");
- expect(number(9, 2)).toEqual("9.00");
- expect(number(.9, 2)).toEqual("0.90");
- expect(number(.99, 2)).toEqual("0.99");
- expect(number(.999, 3)).toEqual("0.999");
- expect(number(.9999, 3)).toEqual("1.000");
- expect(number(1.9, 2)).toEqual("1.90");
- expect(number(1.99, 2)).toEqual("1.99");
- expect(number(1.999, 3)).toEqual("1.999");
- expect(number(1.9999, 3)).toEqual("2.000");
- expect(number(1234.567, 0)).toEqual("1,235");
- expect(number(1234.567, 1)).toEqual("1,234.6");
- expect(number(1234.567, 2)).toEqual("1,234.57");
- expect(number(1.255, 0)).toEqual("1");
- expect(number(1.255, 1)).toEqual("1.3");
- expect(number(1.255, 2)).toEqual("1.26");
- expect(number(1.255, 3)).toEqual("1.255");
- expect(number(0, 8)).toEqual("0.00000000");
+ expect(number(1, 2)).toEqual('1.00');
+ expect(number(.1, 2)).toEqual('0.10');
+ expect(number(.01, 2)).toEqual('0.01');
+ expect(number(.001, 3)).toEqual('0.001');
+ expect(number(.0001, 3)).toEqual('0.000');
+ expect(number(9, 2)).toEqual('9.00');
+ expect(number(.9, 2)).toEqual('0.90');
+ expect(number(.99, 2)).toEqual('0.99');
+ expect(number(.999, 3)).toEqual('0.999');
+ expect(number(.9999, 3)).toEqual('1.000');
+ expect(number(1.9, 2)).toEqual('1.90');
+ expect(number(1.99, 2)).toEqual('1.99');
+ expect(number(1.999, 3)).toEqual('1.999');
+ expect(number(1.9999, 3)).toEqual('2.000');
+ expect(number(1234.567, 0)).toEqual('1,235');
+ expect(number(1234.567, 1)).toEqual('1,234.6');
+ expect(number(1234.567, 2)).toEqual('1,234.57');
+ expect(number(1.255, 0)).toEqual('1');
+ expect(number(1.255, 1)).toEqual('1.3');
+ expect(number(1.255, 2)).toEqual('1.26');
+ expect(number(1.255, 3)).toEqual('1.255');
+ expect(number(0, 8)).toEqual('0.00000000');
/* eslint-enable */
});
@@ -271,10 +271,10 @@ describe('filters', function() {
describe('json', function() {
it('should do basic filter', function() {
- expect(filter('json')({a:"b"})).toEqual(toJson({a:"b"}, true));
+ expect(filter('json')({a:'b'})).toEqual(toJson({a:'b'}, true));
});
it('should allow custom indentation', function() {
- expect(filter('json')({a:"b"}, 4)).toEqual(toJson({a:"b"}, 4));
+ expect(filter('json')({a:'b'}, 4)).toEqual(toJson({a:'b'}, 4));
});
});
@@ -323,7 +323,7 @@ describe('filters', function() {
it('should accept number or number string representing milliseconds as input', function() {
expect(date(noon.getTime())).toEqual(date(noon.getTime(), 'mediumDate'));
- expect(date(noon.getTime() + "")).toEqual(date(noon.getTime() + "", 'mediumDate'));
+ expect(date(noon.getTime() + '')).toEqual(date(noon.getTime() + '', 'mediumDate'));
});
it('should accept various format strings', function() {
@@ -333,55 +333,55 @@ describe('filters', function() {
expect(date(secondWeek, 'yyyy-Www')).
toEqual('2013-W02');
- expect(date(morning, "yy-MM-dd HH:mm:ss")).
+ expect(date(morning, 'yy-MM-dd HH:mm:ss')).
toEqual('10-09-03 07:05:08');
- expect(date(morning, "yy-MM-dd HH:mm:ss.sss")).
+ expect(date(morning, 'yy-MM-dd HH:mm:ss.sss')).
toEqual('10-09-03 07:05:08.001');
- expect(date(midnight, "yyyy-M-d h=H:m:saZ")).
+ expect(date(midnight, 'yyyy-M-d h=H:m:saZ')).
toEqual('2010-9-3 12=0:5:8AM-0500');
- expect(date(midnight, "yyyy-MM-dd hh=HH:mm:ssaZ")).
+ expect(date(midnight, 'yyyy-MM-dd hh=HH:mm:ssaZ')).
toEqual('2010-09-03 12=00:05:08AM-0500');
- expect(date(midnight, "yyyy-MM-dd hh=HH:mm:ss.sssaZ")).
+ expect(date(midnight, 'yyyy-MM-dd hh=HH:mm:ss.sssaZ')).
toEqual('2010-09-03 12=00:05:08.123AM-0500');
- expect(date(noon, "yyyy-MM-dd hh=HH:mm:ssaZ")).
+ expect(date(noon, 'yyyy-MM-dd hh=HH:mm:ssaZ')).
toEqual('2010-09-03 12=12:05:08PM-0500');
- expect(date(noon, "yyyy-MM-dd hh=HH:mm:ss.sssaZ")).
+ expect(date(noon, 'yyyy-MM-dd hh=HH:mm:ss.sssaZ')).
toEqual('2010-09-03 12=12:05:08.012PM-0500');
- expect(date(noon, "EEE, MMM d, yyyy")).
+ expect(date(noon, 'EEE, MMM d, yyyy')).
toEqual('Fri, Sep 3, 2010');
- expect(date(noon, "EEEE, MMMM dd, yyyy")).
+ expect(date(noon, 'EEEE, MMMM dd, yyyy')).
toEqual('Friday, September 03, 2010');
- expect(date(earlyDate, "MMMM dd, y")).
+ expect(date(earlyDate, 'MMMM dd, y')).
toEqual('September 03, 1');
- expect(date(earlyDate, "MMMM dd, yyyy")).
+ expect(date(earlyDate, 'MMMM dd, yyyy')).
toEqual('September 03, 0001');
- expect(date(year0Date, "dd MMMM y G")).
+ expect(date(year0Date, 'dd MMMM y G')).
toEqual('25 December 1 BC');
- expect(date(bcDate, "dd MMMM y G")).
+ expect(date(bcDate, 'dd MMMM y G')).
toEqual('16 January 27 BC');
- expect(date(noon, "MMMM dd, y G")).
+ expect(date(noon, 'MMMM dd, y G')).
toEqual('September 03, 2010 AD');
- expect(date(noon, "MMMM dd, y GG")).
+ expect(date(noon, 'MMMM dd, y GG')).
toEqual('September 03, 2010 AD');
- expect(date(noon, "MMMM dd, y GGG")).
+ expect(date(noon, 'MMMM dd, y GGG')).
toEqual('September 03, 2010 AD');
- expect(date(noon, "MMMM dd, y GGGG")).
+ expect(date(noon, 'MMMM dd, y GGGG')).
toEqual('September 03, 2010 Anno Domini');
});
@@ -415,19 +415,19 @@ describe('filters', function() {
var eastOfUTCPartial = new angular.mock.TzDate(-5.5, '2010-09-03T12:05:08.000Z');
var westOfUTCPartial = new angular.mock.TzDate(+5.5, '2010-09-03T12:05:08.000Z');
- expect(date(utc, "yyyy-MM-ddTHH:mm:ssZ")).
+ expect(date(utc, 'yyyy-MM-ddTHH:mm:ssZ')).
toEqual('2010-09-03T12:05:08+0000');
- expect(date(eastOfUTC, "yyyy-MM-ddTHH:mm:ssZ")).
+ expect(date(eastOfUTC, 'yyyy-MM-ddTHH:mm:ssZ')).
toEqual('2010-09-03T17:05:08+0500');
- expect(date(westOfUTC, "yyyy-MM-ddTHH:mm:ssZ")).
+ expect(date(westOfUTC, 'yyyy-MM-ddTHH:mm:ssZ')).
toEqual('2010-09-03T07:05:08-0500');
- expect(date(eastOfUTCPartial, "yyyy-MM-ddTHH:mm:ssZ")).
+ expect(date(eastOfUTCPartial, 'yyyy-MM-ddTHH:mm:ssZ')).
toEqual('2010-09-03T17:35:08+0530');
- expect(date(westOfUTCPartial, "yyyy-MM-ddTHH:mm:ssZ")).
+ expect(date(westOfUTCPartial, 'yyyy-MM-ddTHH:mm:ssZ')).
toEqual('2010-09-03T06:35:08-0530');
});
@@ -462,41 +462,41 @@ describe('filters', function() {
});
it('should treat single quoted strings as string literals', function() {
- expect(date(midnight, "yyyy'de' 'a'x'dd' 'adZ' h=H:m:saZ")).
+ expect(date(midnight, 'yyyy\'de\' \'a\'x\'dd\' \'adZ\' h=H:m:saZ')).
toEqual('2010de axdd adZ 12=0:5:8AM-0500');
});
it('should treat a sequence of two single quotes as a literal single quote', function() {
- expect(date(midnight, "yyyy'de' 'a''dd' 'adZ' h=H:m:saZ")).
- toEqual("2010de a'dd adZ 12=0:5:8AM-0500");
- expect(date(midnight, "EEE, MMM d, ''yy")).
- toEqual("Fri, Sep 3, '10");
+ expect(date(midnight, 'yyyy\'de\' \'a\'\'dd\' \'adZ\' h=H:m:saZ')).
+ toEqual('2010de a\'dd adZ 12=0:5:8AM-0500');
+ expect(date(midnight, 'EEE, MMM d, \'\'yy')).
+ toEqual('Fri, Sep 3, \'10');
});
it('should accept default formats', function() {
- expect(date(noon, "medium")).
+ expect(date(noon, 'medium')).
toEqual('Sep 3, 2010 12:05:08 PM');
- expect(date(noon, "short")).
+ expect(date(noon, 'short')).
toEqual('9/3/10 12:05 PM');
- expect(date(noon, "fullDate")).
+ expect(date(noon, 'fullDate')).
toEqual('Friday, September 3, 2010');
- expect(date(noon, "longDate")).
+ expect(date(noon, 'longDate')).
toEqual('September 3, 2010');
- expect(date(noon, "mediumDate")).
+ expect(date(noon, 'mediumDate')).
toEqual('Sep 3, 2010');
- expect(date(noon, "shortDate")).
+ expect(date(noon, 'shortDate')).
toEqual('9/3/10');
- expect(date(noon, "mediumTime")).
+ expect(date(noon, 'mediumTime')).
toEqual('12:05:08 PM');
- expect(date(noon, "shortTime")).
+ expect(date(noon, 'shortTime')).
toEqual('12:05 PM');
});
diff --git a/test/ng/filter/limitToSpec.js b/test/ng/filter/limitToSpec.js
index ea79e3db3cf8..3f25080b3470 100644
--- a/test/ng/filter/limitToSpec.js
+++ b/test/ng/filter/limitToSpec.js
@@ -9,7 +9,7 @@ describe('Filter: limitTo', function() {
beforeEach(inject(function($filter) {
items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
- str = "tuvwxyz";
+ str = 'tuvwxyz';
number = 100.045;
arrayLike = {
0: 'a',
@@ -31,10 +31,10 @@ describe('Filter: limitTo', function() {
it('should return the first X items when X is positive', function() {
expect(limitTo(items, 3)).toEqual(['a', 'b', 'c']);
expect(limitTo(items, '3')).toEqual(['a', 'b', 'c']);
- expect(limitTo(str, 3)).toEqual("tuv");
- expect(limitTo(str, '3')).toEqual("tuv");
- expect(limitTo(number, 3)).toEqual("100");
- expect(limitTo(number, '3')).toEqual("100");
+ expect(limitTo(str, 3)).toEqual('tuv');
+ expect(limitTo(str, '3')).toEqual('tuv');
+ expect(limitTo(number, 3)).toEqual('100');
+ expect(limitTo(number, '3')).toEqual('100');
expect(limitTo(arrayLike, 3)).toEqual(['a', 'b', 'c']);
expect(limitTo(arrayLike, '3')).toEqual(['a', 'b', 'c']);
});
@@ -42,8 +42,8 @@ describe('Filter: limitTo', function() {
it('should return the first X items beginning from index Y when X and Y are positive', function() {
expect(limitTo(items, 3, '3')).toEqual(['d', 'e', 'f']);
expect(limitTo(items, '3', 3)).toEqual(['d', 'e', 'f']);
- expect(limitTo(str, 3, 3)).toEqual("wxy");
- expect(limitTo(str, '3', '3')).toEqual("wxy");
+ expect(limitTo(str, 3, 3)).toEqual('wxy');
+ expect(limitTo(str, '3', '3')).toEqual('wxy');
expect(limitTo(arrayLike, 3, 3)).toEqual(['d', 'e', 'f']);
expect(limitTo(arrayLike, '3', '3')).toEqual(['d', 'e', 'f']);
});
@@ -51,8 +51,8 @@ describe('Filter: limitTo', function() {
it('should return the first X items beginning from index Y when X is positive and Y is negative', function() {
expect(limitTo(items, 3, '-3')).toEqual(['f', 'g', 'h']);
expect(limitTo(items, '3', -3)).toEqual(['f', 'g', 'h']);
- expect(limitTo(str, 3, -3)).toEqual("xyz");
- expect(limitTo(str, '3', '-3')).toEqual("xyz");
+ expect(limitTo(str, 3, -3)).toEqual('xyz');
+ expect(limitTo(str, '3', '-3')).toEqual('xyz');
expect(limitTo(arrayLike, 3, '-3')).toEqual(['f', 'g', 'h']);
expect(limitTo(arrayLike, '3', -3)).toEqual(['f', 'g', 'h']);
});
@@ -60,10 +60,10 @@ describe('Filter: limitTo', function() {
it('should return the last X items when X is negative', function() {
expect(limitTo(items, -3)).toEqual(['f', 'g', 'h']);
expect(limitTo(items, '-3')).toEqual(['f', 'g', 'h']);
- expect(limitTo(str, -3)).toEqual("xyz");
- expect(limitTo(str, '-3')).toEqual("xyz");
- expect(limitTo(number, -3)).toEqual("045");
- expect(limitTo(number, '-3')).toEqual("045");
+ expect(limitTo(str, -3)).toEqual('xyz');
+ expect(limitTo(str, '-3')).toEqual('xyz');
+ expect(limitTo(number, -3)).toEqual('045');
+ expect(limitTo(number, '-3')).toEqual('045');
expect(limitTo(arrayLike, -3)).toEqual(['f', 'g', 'h']);
expect(limitTo(arrayLike, '-3')).toEqual(['f', 'g', 'h']);
});
@@ -71,8 +71,8 @@ describe('Filter: limitTo', function() {
it('should return the last X items until index Y when X and Y are negative', function() {
expect(limitTo(items, -3, '-3')).toEqual(['c', 'd', 'e']);
expect(limitTo(items, '-3', -3)).toEqual(['c', 'd', 'e']);
- expect(limitTo(str, -3, -3)).toEqual("uvw");
- expect(limitTo(str, '-3', '-3')).toEqual("uvw");
+ expect(limitTo(str, -3, -3)).toEqual('uvw');
+ expect(limitTo(str, '-3', '-3')).toEqual('uvw');
expect(limitTo(arrayLike, -3, '-3')).toEqual(['c', 'd', 'e']);
expect(limitTo(arrayLike, '-3', -3)).toEqual(['c', 'd', 'e']);
});
@@ -80,8 +80,8 @@ describe('Filter: limitTo', function() {
it('should return the last X items until index Y when X is negative and Y is positive', function() {
expect(limitTo(items, -3, '4')).toEqual(['b', 'c', 'd']);
expect(limitTo(items, '-3', 4)).toEqual(['b', 'c', 'd']);
- expect(limitTo(str, -3, 4)).toEqual("uvw");
- expect(limitTo(str, '-3', '4')).toEqual("uvw");
+ expect(limitTo(str, -3, 4)).toEqual('uvw');
+ expect(limitTo(str, '-3', '4')).toEqual('uvw');
expect(limitTo(arrayLike, -3, '4')).toEqual(['b', 'c', 'd']);
expect(limitTo(arrayLike, '-3', 4)).toEqual(['b', 'c', 'd']);
});
@@ -107,8 +107,8 @@ describe('Filter: limitTo', function() {
});
it('should return an empty string when X = 0', function() {
- expect(limitTo(str, 0)).toEqual("");
- expect(limitTo(str, '0')).toEqual("");
+ expect(limitTo(str, 0)).toEqual('');
+ expect(limitTo(str, '0')).toEqual('');
});
it('should return entire string when X cannot be parsed', function() {
@@ -193,15 +193,15 @@ describe('Filter: limitTo', function() {
});
it('should return an empty string if Y exceeds input length', function() {
- expect(limitTo(str, '3', 12)).toEqual("");
- expect(limitTo(str, -3, '12')).toEqual("");
+ expect(limitTo(str, '3', 12)).toEqual('');
+ expect(limitTo(str, -3, '12')).toEqual('');
});
it('should start at 0 if Y is negative and exceeds input length', function() {
expect(limitTo(items, 4, '-12')).toEqual(['a', 'b', 'c', 'd']);
expect(limitTo(items, '-4', -12)).toEqual(['e', 'f', 'g', 'h']);
- expect(limitTo(str, 4, '-12')).toEqual("tuvw");
- expect(limitTo(str, '-4', -12)).toEqual("wxyz");
+ expect(limitTo(str, 4, '-12')).toEqual('tuvw');
+ expect(limitTo(str, '-4', -12)).toEqual('wxyz');
expect(limitTo(arrayLike, 4, '-12')).toEqual(['a', 'b', 'c', 'd']);
expect(limitTo(arrayLike, '-4', -12)).toEqual(['e', 'f', 'g', 'h']);
});
@@ -209,8 +209,8 @@ describe('Filter: limitTo', function() {
it('should return the entire string beginning from Y if X is positive and X+Y exceeds input length', function() {
expect(limitTo(items, 7, 3)).toEqual(['d', 'e', 'f', 'g', 'h']);
expect(limitTo(items, 7, -3)).toEqual(['f', 'g', 'h']);
- expect(limitTo(str, 6, 3)).toEqual("wxyz");
- expect(limitTo(str, 6, -3)).toEqual("xyz");
+ expect(limitTo(str, 6, 3)).toEqual('wxyz');
+ expect(limitTo(str, 6, -3)).toEqual('xyz');
expect(limitTo(arrayLike, 7, 3)).toEqual(['d', 'e', 'f', 'g', 'h']);
expect(limitTo(arrayLike, 7, -3)).toEqual(['f', 'g', 'h']);
});
@@ -218,8 +218,8 @@ describe('Filter: limitTo', function() {
it('should return the entire string until index Y if X is negative and X+Y exceeds input length', function() {
expect(limitTo(items, -7, 3)).toEqual(['a', 'b', 'c']);
expect(limitTo(items, -7, -3)).toEqual(['a', 'b', 'c', 'd', 'e']);
- expect(limitTo(str, -6, 3)).toEqual("tuv");
- expect(limitTo(str, -6, -3)).toEqual("tuvw");
+ expect(limitTo(str, -6, 3)).toEqual('tuv');
+ expect(limitTo(str, -6, -3)).toEqual('tuvw');
expect(limitTo(arrayLike, -7, 3)).toEqual(['a', 'b', 'c']);
expect(limitTo(arrayLike, -7, -3)).toEqual(['a', 'b', 'c', 'd', 'e']);
});
@@ -230,7 +230,7 @@ describe('Filter: limitTo', function() {
}
var argsObj = getArguments({name: 'Misko'}, {name: 'Igor'}, {name: 'Brad'});
- var nodeList = jqLite("Misko Igor Brad
")[0].childNodes;
+ var nodeList = jqLite('Misko Igor Brad
')[0].childNodes;
expect(limitTo(argsObj, 2).length).toBe(2);
expect(limitTo('abc', 1).length).toBe(1);
diff --git a/test/ng/filter/orderBySpec.js b/test/ng/filter/orderBySpec.js
index 45feac983efb..75137682d1d3 100644
--- a/test/ng/filter/orderBySpec.js
+++ b/test/ng/filter/orderBySpec.js
@@ -112,10 +112,10 @@ describe('Filter: orderBy', function() {
it('should support string predicates with names containing non-identifier characters', function() {
/* eslint-disable no-floating-decimal */
- expect(orderBy([{"Tip %": .25}, {"Tip %": .15}, {"Tip %": .40}], '"Tip %"'))
- .toEqualData([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}]);
- expect(orderBy([{"원": 76000}, {"원": 31000}, {"원": 156000}], '"원"'))
- .toEqualData([{"원": 31000}, {"원": 76000}, {"원": 156000}]);
+ expect(orderBy([{'Tip %': .25}, {'Tip %': .15}, {'Tip %': .40}], '"Tip %"'))
+ .toEqualData([{'Tip %': .15}, {'Tip %': .25}, {'Tip %': .40}]);
+ expect(orderBy([{'원': 76000}, {'원': 31000}, {'원': 156000}], '"원"'))
+ .toEqualData([{'원': 31000}, {'원': 76000}, {'원': 156000}]);
/* eslint-enable */
});
@@ -123,7 +123,7 @@ describe('Filter: orderBy', function() {
it('should throw if quoted string predicate is quoted incorrectly', function() {
/* eslint-disable no-floating-decimal */
expect(function() {
- return orderBy([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}], '"Tip %\'');
+ return orderBy([{'Tip %': .15}, {'Tip %': .25}, {'Tip %': .40}], '"Tip %\'');
}).toThrow();
/* eslint-enable */
});
@@ -601,8 +601,8 @@ describe('Filter: orderBy', function() {
it('shouldSortArrayInReverse', function() {
expect(orderBy([{a:15}, {a:2}], 'a', true)).toEqualData([{a:15}, {a:2}]);
- expect(orderBy([{a:15}, {a:2}], 'a', "T")).toEqualData([{a:15}, {a:2}]);
- expect(orderBy([{a:15}, {a:2}], 'a', "reverse")).toEqualData([{a:15}, {a:2}]);
+ expect(orderBy([{a:15}, {a:2}], 'a', 'T')).toEqualData([{a:15}, {a:2}]);
+ expect(orderBy([{a:15}, {a:2}], 'a', 'reverse')).toEqualData([{a:15}, {a:2}]);
});
@@ -653,10 +653,10 @@ describe('Filter: orderBy', function() {
it('should support string predicates with names containing non-identifier characters', function() {
/* eslint-disable no-floating-decimal */
- expect(orderBy([{"Tip %": .25}, {"Tip %": .15}, {"Tip %": .40}], '"Tip %"'))
- .toEqualData([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}]);
- expect(orderBy([{"원": 76000}, {"원": 31000}, {"원": 156000}], '"원"'))
- .toEqualData([{"원": 31000}, {"원": 76000}, {"원": 156000}]);
+ expect(orderBy([{'Tip %': .25}, {'Tip %': .15}, {'Tip %': .40}], '"Tip %"'))
+ .toEqualData([{'Tip %': .15}, {'Tip %': .25}, {'Tip %': .40}]);
+ expect(orderBy([{'원': 76000}, {'원': 31000}, {'원': 156000}], '"원"'))
+ .toEqualData([{'원': 31000}, {'원': 76000}, {'원': 156000}]);
/* eslint-enable */
});
@@ -664,7 +664,7 @@ describe('Filter: orderBy', function() {
it('should throw if quoted string predicate is quoted incorrectly', function() {
/* eslint-disable no-floating-decimal */
expect(function() {
- return orderBy([{"Tip %": .15}, {"Tip %": .25}, {"Tip %": .40}], '"Tip %\'');
+ return orderBy([{'Tip %': .15}, {'Tip %': .25}, {'Tip %': .40}], '"Tip %\'');
}).toThrow();
/* eslint-enable */
});
diff --git a/test/ng/httpBackendSpec.js b/test/ng/httpBackendSpec.js
index b8031ca97871..1fce7c92a602 100644
--- a/test/ng/httpBackendSpec.js
+++ b/test/ng/httpBackendSpec.js
@@ -72,7 +72,7 @@ describe('$httpBackend', function() {
it('should pass the correct falsy value to send if falsy body is set (excluding undefined, NaN)',
function() {
- var values = [false, 0, "", null];
+ var values = [false, 0, '', null];
angular.forEach(values, function(value) {
$backend('GET', '/some-url', value, noop);
xhr = MockXhr.$$lastInstance;
@@ -349,7 +349,7 @@ describe('$httpBackend', function() {
expect(url[1]).toBe('http://example.org/path');
$jsonpCallbacks[url[2]]('some-data');
- browserTrigger(script, "load");
+ browserTrigger(script, 'load');
expect(callback).toHaveBeenCalledOnce();
});
@@ -366,7 +366,7 @@ describe('$httpBackend', function() {
callbackId = script.src.match(SCRIPT_URL)[2];
$jsonpCallbacks[callbackId]('some-data');
- browserTrigger(script, "load");
+ browserTrigger(script, 'load');
expect($jsonpCallbacks.removeCallback).toHaveBeenCalledOnceWith(callbackId);
expect(fakeDocument.body.removeChild).toHaveBeenCalledOnceWith(script);
@@ -462,14 +462,14 @@ describe('$httpBackend', function() {
//temporarily overriding the DOM element to pretend that the test runs origin with file:// protocol
urlParsingNode = {
- hash: "#/C:/",
- host: "",
- hostname: "",
- href: "file:///C:/base#!/C:/foo",
- pathname: "/C:/foo",
- port: "",
- protocol: "file:",
- search: "",
+ hash: '#/C:/',
+ host: '',
+ hostname: '',
+ href: 'file:///C:/base#!/C:/foo',
+ pathname: '/C:/foo',
+ port: '',
+ protocol: 'file:',
+ search: '',
setAttribute: angular.noop
};
diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js
index 78bc5ee018cd..09a0cfb3199d 100644
--- a/test/ng/httpSpec.js
+++ b/test/ng/httpSpec.js
@@ -141,7 +141,7 @@ describe('$http', function() {
return {
request: function(config) {
expect(config.url).toEqual('/url');
- expect(config.data).toEqual({one: "two"});
+ expect(config.data).toEqual({one: 'two'});
expect(config.headers.foo).toEqual('bar');
run = true;
return config;
@@ -1093,7 +1093,7 @@ describe('$http', function() {
it('should transform object with date into json', function() {
- $httpBackend.expect('POST', '/url', {"date": new Date(Date.UTC(2013, 11, 25))}).respond('');
+ $httpBackend.expect('POST', '/url', {'date': new Date(Date.UTC(2013, 11, 25))}).respond('');
$http({method: 'POST', url: '/url', data: {date: new Date(Date.UTC(2013, 11, 25))}});
});
@@ -1732,7 +1732,7 @@ describe('$http', function() {
expect(callback.calls.mostRecent().args[0]).toBe('content');
// Invalidate cache entry.
- $http.defaults.cache.remove("/url");
+ $http.defaults.cache.remove('/url');
// After cache entry removed, a request should be sent to server.
$httpBackend.expect('GET', '/url').respond(200, 'content');
diff --git a/test/ng/interpolateSpec.js b/test/ng/interpolateSpec.js
index 2aae67b34fa1..f8ed846d93d2 100644
--- a/test/ng/interpolateSpec.js
+++ b/test/ng/interpolateSpec.js
@@ -73,12 +73,12 @@ describe('$interpolate', function() {
it('should ignore undefined model', inject(function($interpolate) {
- expect($interpolate("Hello {{'World'}}{{foo}}")({})).toBe('Hello World');
+ expect($interpolate('Hello {{\'World\'}}{{foo}}')({})).toBe('Hello World');
}));
it('should interpolate with undefined context', inject(function($interpolate) {
- expect($interpolate("Hello, world!{{bloop}}")()).toBe("Hello, world!");
+ expect($interpolate('Hello, world!{{bloop}}')()).toBe('Hello, world!');
}));
describe('watching', function() {
@@ -247,7 +247,7 @@ describe('$interpolate', function() {
it('should NOT interpolate non-trusted expressions', inject(function($interpolate, $rootScope) {
var scope = $rootScope.$new();
- scope.foo = "foo";
+ scope.foo = 'foo';
expect(function() {
$interpolate('{{foo}}', true, sce.CSS)(scope);
@@ -256,7 +256,7 @@ describe('$interpolate', function() {
it('should NOT interpolate mistyped expressions', inject(function($interpolate, $rootScope) {
var scope = $rootScope.$new();
- scope.foo = sce.trustAsCss("foo");
+ scope.foo = sce.trustAsCss('foo');
expect(function() {
$interpolate('{{foo}}', true, sce.HTML)(scope);
@@ -264,12 +264,12 @@ describe('$interpolate', function() {
}));
it('should interpolate trusted expressions in a regular context', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
+ var foo = sce.trustAsCss('foo');
expect($interpolate('{{foo}}', true)({foo: foo})).toBe('foo');
}));
it('should interpolate trusted expressions in a specific trustedContext', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
+ var foo = sce.trustAsCss('foo');
expect($interpolate('{{foo}}', true, sce.CSS)({foo: foo})).toBe('foo');
}));
@@ -277,15 +277,15 @@ describe('$interpolate', function() {
// instance, you can construct evil JS code by putting together pieces of JS strings that are by
// themselves safe to execute in isolation.)
it('should NOT interpolate trusted expressions with multiple parts', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
- var bar = sce.trustAsCss("bar");
+ var foo = sce.trustAsCss('foo');
+ var bar = sce.trustAsCss('bar');
expect(function() {
return $interpolate('{{foo}}{{bar}}', true, sce.CSS)({foo: foo, bar: bar});
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{foo}}{{bar}}\n" +
- "Strict Contextual Escaping disallows interpolations that concatenate multiple " +
- "expressions when a trusted value is required. See " +
- "http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\n' +
+ 'Strict Contextual Escaping disallows interpolations that concatenate multiple ' +
+ 'expressions when a trusted value is required. See ' +
+ 'http://docs.angularjs.org/api/ng.$sce');
}));
});
@@ -305,50 +305,50 @@ describe('$interpolate', function() {
describe('parseBindings', function() {
it('should Parse Text With No Bindings', inject(function($interpolate) {
- expect($interpolate("a").expressions).toEqual([]);
+ expect($interpolate('a').expressions).toEqual([]);
}));
it('should Parse Empty Text', inject(function($interpolate) {
- expect($interpolate("").expressions).toEqual([]);
+ expect($interpolate('').expressions).toEqual([]);
}));
it('should Parse Inner Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("a{{b}}C"),
+ var interpolateFn = $interpolate('a{{b}}C'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('a123C');
}));
it('should Parse Ending Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("a{{b}}"),
+ var interpolateFn = $interpolate('a{{b}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('a123');
}));
it('should Parse Begging Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}c"),
+ var interpolateFn = $interpolate('{{b}}c'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('123c');
}));
it('should Parse Loan Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}"),
+ var interpolateFn = $interpolate('{{b}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('123');
}));
it('should Parse Two Bindings', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}{{c}}"),
+ var interpolateFn = $interpolate('{{b}}{{c}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b', 'c']);
expect(interpolateFn({b: 111, c: 222})).toEqual('111222');
}));
it('should Parse Two Bindings With Text In Middle', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}x{{c}}"),
+ var interpolateFn = $interpolate('{{b}}x{{c}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b', 'c']);
expect(interpolateFn({b: 111, c: 222})).toEqual('111x222');
@@ -369,21 +369,21 @@ describe('$interpolate', function() {
expect(function() {
$interpolate('constant/{{var}}', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: constant/{{var}}\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: constant/{{var}}\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
expect(function() {
$interpolate('{{var}}/constant', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{var}}/constant\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{var}}/constant\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
expect(function() {
$interpolate('{{foo}}{{bar}}', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{foo}}{{bar}}\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
}));
it('should interpolate a multi-part expression when isTrustedContext is false', inject(function($interpolate) {
diff --git a/test/ng/intervalSpec.js b/test/ng/intervalSpec.js
index 300cef7e1f2e..039dc78121e8 100644
--- a/test/ng/intervalSpec.js
+++ b/test/ng/intervalSpec.js
@@ -243,14 +243,14 @@ describe('$interval', function() {
it('should delegate exception to the $exceptionHandler service', inject(
function($interval, $exceptionHandler, $window) {
- $interval(function() { throw "Test Error"; }, 1000);
+ $interval(function() { throw 'Test Error'; }, 1000);
expect($exceptionHandler.errors).toEqual([]);
$window.flush(1000);
- expect($exceptionHandler.errors).toEqual(["Test Error"]);
+ expect($exceptionHandler.errors).toEqual(['Test Error']);
$window.flush(1000);
- expect($exceptionHandler.errors).toEqual(["Test Error", "Test Error"]);
+ expect($exceptionHandler.errors).toEqual(['Test Error', 'Test Error']);
}));
@@ -258,7 +258,7 @@ describe('$interval', function() {
function($interval, $rootScope, $window) {
var applySpy = spyOn($rootScope, '$apply').and.callThrough();
- $interval(function() { throw "Test Error"; }, 1000);
+ $interval(function() { throw 'Test Error'; }, 1000);
expect(applySpy).not.toHaveBeenCalled();
$window.flush(1000);
@@ -269,7 +269,7 @@ describe('$interval', function() {
it('should still update the interval promise when an exception is thrown',
inject(function($interval, $window) {
var log = [],
- promise = $interval(function() { throw "Some Error"; }, 1000);
+ promise = $interval(function() { throw 'Some Error'; }, 1000);
promise.then(function(value) { log.push('promise success: ' + value); },
function(err) { log.push('promise error: ' + err); },
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js
index 20567017c5c7..133cae044d80 100644
--- a/test/ng/locationSpec.js
+++ b/test/ng/locationSpec.js
@@ -47,14 +47,14 @@ describe('$location', function() {
//temporarily overriding the DOM element
//with output from IE, if not in IE
urlParsingNode = {
- hash: "#/C:/",
- host: "",
- hostname: "",
- href: "file:///C:/base#!/C:/foo",
- pathname: "/C:/foo",
- port: "",
- protocol: "file:",
- search: "",
+ hash: '#/C:/',
+ host: '',
+ hostname: '',
+ href: 'file:///C:/base#!/C:/foo',
+ pathname: '/C:/foo',
+ port: '',
+ protocol: 'file:',
+ search: '',
setAttribute: angular.noop
};
}));
@@ -2442,7 +2442,7 @@ describe('$location', function() {
expect(function() {
$injector.get('$location');
}).toThrowMinErr('$location', 'nobase',
- "$location in HTML5 mode requires a tag to be present!");
+ '$location in HTML5 mode requires a tag to be present!');
});
});
@@ -2460,7 +2460,7 @@ describe('$location', function() {
expect(function() {
$injector.get('$location');
}).not.toThrowMinErr('$location', 'nobase',
- "$location in HTML5 mode requires a tag to be present!");
+ '$location in HTML5 mode requires a tag to be present!');
});
});
@@ -2483,7 +2483,7 @@ describe('$location', function() {
expect(parseLinkAndReturn(locationUrl, 'javascript:void(0)')).toEqual(undefined);
});
- it("should not set hash if one was not originally specified", function() {
+ it('should not set hash if one was not originally specified', function() {
locationUrl = new LocationHashbangUrl('http://server/pre/index.html', 'http://server/pre/', '#');
locationUrl.$$parse('http://server/pre/index.html');
@@ -2491,7 +2491,7 @@ describe('$location', function() {
expect(locationUrl.absUrl()).toBe('http://server/pre/index.html');
});
- it("should parse hash if one was specified", function() {
+ it('should parse hash if one was specified', function() {
locationUrl = new LocationHashbangUrl('http://server/pre/index.html', 'http://server/pre/', '#');
locationUrl.$$parse('http://server/pre/index.html#/foo/bar');
@@ -2500,7 +2500,7 @@ describe('$location', function() {
});
- it("should prefix hash url with / if one was originally missing", function() {
+ it('should prefix hash url with / if one was originally missing', function() {
locationUrl = new LocationHashbangUrl('http://server/pre/index.html', 'http://server/pre/', '#');
locationUrl.$$parse('http://server/pre/index.html#not-starting-with-slash');
diff --git a/test/ng/logSpec.js b/test/ng/logSpec.js
index c4ce3b8339dd..b485f1022931 100644
--- a/test/ng/logSpec.js
+++ b/test/ng/logSpec.js
@@ -64,7 +64,7 @@ describe('$log', function() {
}
));
- describe("IE logging behavior", function() {
+ describe('IE logging behavior', function() {
function removeApplyFunctionForIE() {
log.apply = log.call =
warn.apply = warn.call =
@@ -79,7 +79,7 @@ describe('$log', function() {
debug: debug};
}
- it("should work in IE where console.error doesn't have an apply method", inject(
+ it('should work in IE where console.error doesn\'t have an apply method', inject(
removeApplyFunctionForIE,
function($log) {
$log.log.apply($log);
@@ -91,7 +91,7 @@ describe('$log', function() {
})
);
- it("should not attempt to log the second argument in IE if it is not specified", inject(
+ it('should not attempt to log the second argument in IE if it is not specified', inject(
function() {
log = function(arg1, arg2) { logger += 'log;' + arg2; };
warn = function(arg1, arg2) { logger += 'warn;' + arg2; };
@@ -111,11 +111,11 @@ describe('$log', function() {
);
});
- describe("$log.debug", function() {
+ describe('$log.debug', function() {
beforeEach(initService(false));
- it("should skip debugging output if disabled", inject(
+ it('should skip debugging output if disabled', inject(
function() {
$window.console = {log: log,
warn: warn,
diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js
index ce4797d7d6b6..ea216a644c75 100644
--- a/test/ng/parseSpec.js
+++ b/test/ng/parseSpec.js
@@ -29,7 +29,7 @@ describe('parser', function() {
});
it('should tokenize a string', function() {
- var tokens = lex("a.bc[22]+1.3|f:'a\\'c':\"d\\\"e\"");
+ var tokens = lex('a.bc[22]+1.3|f:\'a\\\'c\':"d\\"e"');
var i = 0;
expect(tokens[i].index).toEqual(0);
expect(tokens[i].text).toEqual('a');
@@ -80,7 +80,7 @@ describe('parser', function() {
i++;
expect(tokens[i].index).toEqual(15);
- expect(tokens[i].value).toEqual("a'c");
+ expect(tokens[i].value).toEqual('a\'c');
i++;
expect(tokens[i].index).toEqual(21);
@@ -131,18 +131,18 @@ describe('parser', function() {
});
it('should tokenize undefined', function() {
- var tokens = lex("undefined");
+ var tokens = lex('undefined');
var i = 0;
expect(tokens[i].index).toEqual(0);
expect(tokens[i].text).toEqual('undefined');
});
it('should tokenize quoted string', function() {
- var str = "['\\'', \"\\\"\"]";
+ var str = '[\'\\\'\', "\\""]';
var tokens = lex(str);
expect(tokens[1].index).toEqual(1);
- expect(tokens[1].value).toEqual("'");
+ expect(tokens[1].value).toEqual('\'');
expect(tokens[3].index).toEqual(7);
expect(tokens[3].value).toEqual('"');
@@ -162,13 +162,13 @@ describe('parser', function() {
});
it('should ignore whitespace', function() {
- var tokens = lex("a \t \n \r b");
+ var tokens = lex('a \t \n \r b');
expect(tokens[0].text).toEqual('a');
expect(tokens[1].text).toEqual('b');
});
it('should tokenize relation and equality', function() {
- var tokens = lex("! == != < > <= >= === !==");
+ var tokens = lex('! == != < > <= >= === !==');
expect(tokens[0].text).toEqual('!');
expect(tokens[1].text).toEqual('==');
expect(tokens[2].text).toEqual('!=');
@@ -181,7 +181,7 @@ describe('parser', function() {
});
it('should tokenize logical and ternary', function() {
- var tokens = lex("&& || ? :");
+ var tokens = lex('&& || ? :');
expect(tokens[0].text).toEqual('&&');
expect(tokens[1].text).toEqual('||');
expect(tokens[2].text).toEqual('?');
@@ -189,7 +189,7 @@ describe('parser', function() {
});
it('should tokenize statements', function() {
- var tokens = lex("a;b;");
+ var tokens = lex('a;b;');
expect(tokens[0].text).toEqual('a');
expect(tokens[1].text).toEqual(';');
expect(tokens[2].text).toEqual('b');
@@ -197,57 +197,57 @@ describe('parser', function() {
});
it('should tokenize function invocation', function() {
- var tokens = lex("a()");
+ var tokens = lex('a()');
expect(tokens.map(function(t) { return t.text;})).toEqual(['a', '(', ')']);
});
it('should tokenize method invocation', function() {
- var tokens = lex("a.b.c (d) - e.f()");
+ var tokens = lex('a.b.c (d) - e.f()');
expect(tokens.map(function(t) { return t.text;})).
toEqual(['a', '.', 'b', '.', 'c', '(', 'd', ')', '-', 'e', '.', 'f', '(', ')']);
});
it('should tokenize number', function() {
- var tokens = lex("0.5");
+ var tokens = lex('0.5');
expect(tokens[0].value).toEqual(0.5);
});
it('should tokenize negative number', inject(function($rootScope) {
- var value = $rootScope.$eval("-0.5");
+ var value = $rootScope.$eval('-0.5');
expect(value).toEqual(-0.5);
- value = $rootScope.$eval("{a:-0.5}");
+ value = $rootScope.$eval('{a:-0.5}');
expect(value).toEqual({a:-0.5});
}));
it('should tokenize number with exponent', inject(function($rootScope) {
- var tokens = lex("0.5E-10");
+ var tokens = lex('0.5E-10');
expect(tokens[0].value).toEqual(0.5E-10);
- expect($rootScope.$eval("0.5E-10")).toEqual(0.5E-10);
+ expect($rootScope.$eval('0.5E-10')).toEqual(0.5E-10);
- tokens = lex("0.5E+10");
+ tokens = lex('0.5E+10');
expect(tokens[0].value).toEqual(0.5E+10);
}));
it('should throws exception for invalid exponent', function() {
expect(function() {
- lex("0.5E-");
+ lex('0.5E-');
}).toThrowMinErr('$parse', 'lexerr', 'Lexer Error: Invalid exponent at column 4 in expression [0.5E-].');
expect(function() {
- lex("0.5E-A");
+ lex('0.5E-A');
}).toThrowMinErr('$parse', 'lexerr', 'Lexer Error: Invalid exponent at column 4 in expression [0.5E-A].');
});
it('should tokenize number starting with a dot', function() {
- var tokens = lex(".5");
+ var tokens = lex('.5');
expect(tokens[0].value).toEqual(0.5);
});
it('should throw error on invalid unicode', function() {
expect(function() {
- lex("'\\u1''bla'");
- }).toThrowMinErr("$parse", "lexerr", "Lexer Error: Invalid unicode escape [\\u1''b] at column 2 in expression ['\\u1''bla'].");
+ lex('\'\\u1\'\'bla\'');
+ }).toThrowMinErr('$parse', 'lexerr', 'Lexer Error: Invalid unicode escape [\\u1\'\'b] at column 2 in expression [\'\\u1\'\'bla\'].');
});
});
@@ -615,13 +615,13 @@ describe('parser', function() {
it('should throw when trying to use non-identifiers as identifiers', function() {
expect(function() { createAst('foo.)'); }).toThrowMinErr('$parse', 'syntax',
- "Syntax Error: Token ')' is not a valid identifier at column 5 of the expression [foo.)");
+ 'Syntax Error: Token \')\' is not a valid identifier at column 5 of the expression [foo.)');
});
it('should throw when all tokens are not consumed', function() {
expect(function() { createAst('foo bar'); }).toThrowMinErr('$parse', 'syntax',
- "Syntax Error: Token 'bar' is an unexpected token at column 5 of the expression [foo bar] starting at [bar]");
+ 'Syntax Error: Token \'bar\' is an unexpected token at column 5 of the expression [foo bar] starting at [bar]');
});
@@ -1831,10 +1831,10 @@ describe('parser', function() {
}));
it('should allow extending literals with csp ' + cspEnabled, inject(function($rootScope) {
- expect($rootScope.$eval("Infinity")).toEqual(Infinity);
- expect($rootScope.$eval("-Infinity")).toEqual(-Infinity);
- expect(function() {$rootScope.$eval("Infinity = 1");}).toThrow();
- expect($rootScope.$eval("Infinity")).toEqual(Infinity);
+ expect($rootScope.$eval('Infinity')).toEqual(Infinity);
+ expect($rootScope.$eval('-Infinity')).toEqual(-Infinity);
+ expect(function() {$rootScope.$eval('Infinity = 1');}).toThrow();
+ expect($rootScope.$eval('Infinity')).toEqual(Infinity);
}));
});
@@ -1852,71 +1852,71 @@ describe('parser', function() {
}));
it('should parse expressions', function() {
- expect(scope.$eval("-1")).toEqual(-1);
- expect(scope.$eval("1 + 2.5")).toEqual(3.5);
- expect(scope.$eval("1 + -2.5")).toEqual(-1.5);
- expect(scope.$eval("1+2*3/4")).toEqual(1 + 2 * 3 / 4);
- expect(scope.$eval("0--1+1.5")).toEqual(0 - -1 + 1.5);
- expect(scope.$eval("-0--1++2*-3/-4")).toEqual(-0 - -1 + +2 * -3 / -4);
- expect(scope.$eval("1/2*3")).toEqual(1 / 2 * 3);
+ expect(scope.$eval('-1')).toEqual(-1);
+ expect(scope.$eval('1 + 2.5')).toEqual(3.5);
+ expect(scope.$eval('1 + -2.5')).toEqual(-1.5);
+ expect(scope.$eval('1+2*3/4')).toEqual(1 + 2 * 3 / 4);
+ expect(scope.$eval('0--1+1.5')).toEqual(0 - -1 + 1.5);
+ expect(scope.$eval('-0--1++2*-3/-4')).toEqual(-0 - -1 + +2 * -3 / -4);
+ expect(scope.$eval('1/2*3')).toEqual(1 / 2 * 3);
});
it('should parse unary', function() {
- expect(scope.$eval("+1")).toEqual(+1);
- expect(scope.$eval("-1")).toEqual(-1);
- expect(scope.$eval("+'1'")).toEqual(+'1');
- expect(scope.$eval("-'1'")).toEqual(-'1');
- expect(scope.$eval("+undefined")).toEqual(0);
- expect(scope.$eval("-undefined")).toEqual(-0);
- expect(scope.$eval("+null")).toEqual(+null);
- expect(scope.$eval("-null")).toEqual(-null);
- expect(scope.$eval("+false")).toEqual(+false);
- expect(scope.$eval("-false")).toEqual(-false);
- expect(scope.$eval("+true")).toEqual(+true);
- expect(scope.$eval("-true")).toEqual(-true);
+ expect(scope.$eval('+1')).toEqual(+1);
+ expect(scope.$eval('-1')).toEqual(-1);
+ expect(scope.$eval('+\'1\'')).toEqual(+'1');
+ expect(scope.$eval('-\'1\'')).toEqual(-'1');
+ expect(scope.$eval('+undefined')).toEqual(0);
+ expect(scope.$eval('-undefined')).toEqual(-0);
+ expect(scope.$eval('+null')).toEqual(+null);
+ expect(scope.$eval('-null')).toEqual(-null);
+ expect(scope.$eval('+false')).toEqual(+false);
+ expect(scope.$eval('-false')).toEqual(-false);
+ expect(scope.$eval('+true')).toEqual(+true);
+ expect(scope.$eval('-true')).toEqual(-true);
});
it('should parse comparison', function() {
/* eslint-disable eqeqeq, no-self-compare */
- expect(scope.$eval("false")).toBeFalsy();
- expect(scope.$eval("!true")).toBeFalsy();
- expect(scope.$eval("1==1")).toBeTruthy();
- expect(scope.$eval("1==true")).toBeTruthy();
+ expect(scope.$eval('false')).toBeFalsy();
+ expect(scope.$eval('!true')).toBeFalsy();
+ expect(scope.$eval('1==1')).toBeTruthy();
+ expect(scope.$eval('1==true')).toBeTruthy();
expect(scope.$eval('1!=true')).toBeFalsy();
- expect(scope.$eval("1===1")).toBeTruthy();
- expect(scope.$eval("1==='1'")).toBeFalsy();
- expect(scope.$eval("1===true")).toBeFalsy();
- expect(scope.$eval("'true'===true")).toBeFalsy();
- expect(scope.$eval("1!==2")).toBeTruthy();
- expect(scope.$eval("1!=='1'")).toBeTruthy();
- expect(scope.$eval("1!=2")).toBeTruthy();
- expect(scope.$eval("1<2")).toBeTruthy();
- expect(scope.$eval("1<=1")).toBeTruthy();
- expect(scope.$eval("1>2")).toEqual(1 > 2);
- expect(scope.$eval("2>=1")).toEqual(2 >= 1);
- expect(scope.$eval("true==2<3")).toEqual(true == 2 < 3);
- expect(scope.$eval("true===2<3")).toEqual(true === 2 < 3);
-
- expect(scope.$eval("true===3===3")).toEqual(true === 3 === 3);
- expect(scope.$eval("3===3===true")).toEqual(3 === 3 === true);
- expect(scope.$eval("3 >= 3 > 2")).toEqual(3 >= 3 > 2);
+ expect(scope.$eval('1===1')).toBeTruthy();
+ expect(scope.$eval('1===\'1\'')).toBeFalsy();
+ expect(scope.$eval('1===true')).toBeFalsy();
+ expect(scope.$eval('\'true\'===true')).toBeFalsy();
+ expect(scope.$eval('1!==2')).toBeTruthy();
+ expect(scope.$eval('1!==\'1\'')).toBeTruthy();
+ expect(scope.$eval('1!=2')).toBeTruthy();
+ expect(scope.$eval('1<2')).toBeTruthy();
+ expect(scope.$eval('1<=1')).toBeTruthy();
+ expect(scope.$eval('1>2')).toEqual(1 > 2);
+ expect(scope.$eval('2>=1')).toEqual(2 >= 1);
+ expect(scope.$eval('true==2<3')).toEqual(true == 2 < 3);
+ expect(scope.$eval('true===2<3')).toEqual(true === 2 < 3);
+
+ expect(scope.$eval('true===3===3')).toEqual(true === 3 === 3);
+ expect(scope.$eval('3===3===true')).toEqual(3 === 3 === true);
+ expect(scope.$eval('3 >= 3 > 2')).toEqual(3 >= 3 > 2);
/* eslint-enable */
});
it('should parse logical', function() {
- expect(scope.$eval("0&&2")).toEqual(0 && 2);
- expect(scope.$eval("0||2")).toEqual(0 || 2);
- expect(scope.$eval("0||1&&2")).toEqual(0 || 1 && 2);
- expect(scope.$eval("true&&a")).toEqual(true && undefined);
- expect(scope.$eval("true&&a()")).toEqual(true && undefined);
- expect(scope.$eval("true&&a()()")).toEqual(true && undefined);
- expect(scope.$eval("true&&a.b")).toEqual(true && undefined);
- expect(scope.$eval("true&&a.b.c")).toEqual(true && undefined);
- expect(scope.$eval("false||a")).toEqual(false || undefined);
- expect(scope.$eval("false||a()")).toEqual(false || undefined);
- expect(scope.$eval("false||a()()")).toEqual(false || undefined);
- expect(scope.$eval("false||a.b")).toEqual(false || undefined);
- expect(scope.$eval("false||a.b.c")).toEqual(false || undefined);
+ expect(scope.$eval('0&&2')).toEqual(0 && 2);
+ expect(scope.$eval('0||2')).toEqual(0 || 2);
+ expect(scope.$eval('0||1&&2')).toEqual(0 || 1 && 2);
+ expect(scope.$eval('true&&a')).toEqual(true && undefined);
+ expect(scope.$eval('true&&a()')).toEqual(true && undefined);
+ expect(scope.$eval('true&&a()()')).toEqual(true && undefined);
+ expect(scope.$eval('true&&a.b')).toEqual(true && undefined);
+ expect(scope.$eval('true&&a.b.c')).toEqual(true && undefined);
+ expect(scope.$eval('false||a')).toEqual(false || undefined);
+ expect(scope.$eval('false||a()')).toEqual(false || undefined);
+ expect(scope.$eval('false||a()()')).toEqual(false || undefined);
+ expect(scope.$eval('false||a.b')).toEqual(false || undefined);
+ expect(scope.$eval('false||a.b.c')).toEqual(false || undefined);
});
it('should parse ternary', function() {
@@ -1984,7 +1984,7 @@ describe('parser', function() {
});
it('should parse string', function() {
- expect(scope.$eval("'a' + 'b c'")).toEqual("ab c");
+ expect(scope.$eval('\'a\' + \'b c\'')).toEqual('ab c');
});
it('should parse filters', function() {
@@ -1993,55 +1993,55 @@ describe('parser', function() {
}));
expect(function() {
- scope.$eval("1|nonexistent");
+ scope.$eval('1|nonexistent');
}).toThrowMinErr('$injector', 'unpr', 'Unknown provider: nonexistentFilterProvider <- nonexistentFilter');
scope.offset = 3;
- expect(scope.$eval("'abcd'|substring:1:offset")).toEqual("bc");
- expect(scope.$eval("'abcd'|substring:1:3|uppercase")).toEqual("BC");
+ expect(scope.$eval('\'abcd\'|substring:1:offset')).toEqual('bc');
+ expect(scope.$eval('\'abcd\'|substring:1:3|uppercase')).toEqual('BC');
});
it('should access scope', function() {
scope.a = 123;
scope.b = {c: 456};
- expect(scope.$eval("a", scope)).toEqual(123);
- expect(scope.$eval("b.c", scope)).toEqual(456);
- expect(scope.$eval("x.y.z", scope)).not.toBeDefined();
+ expect(scope.$eval('a', scope)).toEqual(123);
+ expect(scope.$eval('b.c', scope)).toEqual(456);
+ expect(scope.$eval('x.y.z', scope)).not.toBeDefined();
});
it('should handle white-spaces around dots in paths', function() {
scope.a = {b: 4};
- expect(scope.$eval("a . b", scope)).toEqual(4);
- expect(scope.$eval("a. b", scope)).toEqual(4);
- expect(scope.$eval("a .b", scope)).toEqual(4);
- expect(scope.$eval("a . \nb", scope)).toEqual(4);
+ expect(scope.$eval('a . b', scope)).toEqual(4);
+ expect(scope.$eval('a. b', scope)).toEqual(4);
+ expect(scope.$eval('a .b', scope)).toEqual(4);
+ expect(scope.$eval('a . \nb', scope)).toEqual(4);
});
it('should handle white-spaces around dots in method invocations', function() {
scope.a = {b: function() { return this.c; }, c: 4};
- expect(scope.$eval("a . b ()", scope)).toEqual(4);
- expect(scope.$eval("a. b ()", scope)).toEqual(4);
- expect(scope.$eval("a .b ()", scope)).toEqual(4);
- expect(scope.$eval("a \n . \nb \n ()", scope)).toEqual(4);
+ expect(scope.$eval('a . b ()', scope)).toEqual(4);
+ expect(scope.$eval('a. b ()', scope)).toEqual(4);
+ expect(scope.$eval('a .b ()', scope)).toEqual(4);
+ expect(scope.$eval('a \n . \nb \n ()', scope)).toEqual(4);
});
it('should throw syntax error exception for identifiers ending with a dot', function() {
scope.a = {b: 4};
expect(function() {
- scope.$eval("a.", scope);
+ scope.$eval('a.', scope);
}).toThrowMinErr('$parse', 'ueoe',
- "Unexpected end of expression: a.");
+ 'Unexpected end of expression: a.');
expect(function() {
- scope.$eval("a .", scope);
+ scope.$eval('a .', scope);
}).toThrowMinErr('$parse', 'ueoe',
- "Unexpected end of expression: a .");
+ 'Unexpected end of expression: a .');
});
it('should resolve deeply nested paths (important for CSP mode)', function() {
scope.a = {b: {c: {d: {e: {f: {g: {h: {i: {j: {k: {l: {m: {n: 'nooo!'}}}}}}}}}}}}};
- expect(scope.$eval("a.b.c.d.e.f.g.h.i.j.k.l.m.n", scope)).toBe('nooo!');
+ expect(scope.$eval('a.b.c.d.e.f.g.h.i.j.k.l.m.n', scope)).toBe('nooo!');
});
forEach([2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 42, 99], function(pathLength) {
@@ -2086,7 +2086,7 @@ describe('parser', function() {
// regression
scope.watch = 1;
scope.toString = function toString() {
- return "custom toString";
+ return 'custom toString';
};
expect(scope.$eval('watch', scope)).toBe(1);
@@ -2114,17 +2114,17 @@ describe('parser', function() {
});
it('should evaluate grouped expressions', function() {
- expect(scope.$eval("(1+2)*3")).toEqual((1 + 2) * 3);
+ expect(scope.$eval('(1+2)*3')).toEqual((1 + 2) * 3);
});
it('should evaluate assignments', function() {
- expect(scope.$eval("a=12")).toEqual(12);
+ expect(scope.$eval('a=12')).toEqual(12);
expect(scope.a).toEqual(12);
- expect(scope.$eval("x.y.z=123;")).toEqual(123);
+ expect(scope.$eval('x.y.z=123;')).toEqual(123);
expect(scope.x.y.z).toEqual(123);
- expect(scope.$eval("a=123; b=234")).toEqual(234);
+ expect(scope.$eval('a=123; b=234')).toEqual(234);
expect(scope.a).toEqual(123);
expect(scope.b).toEqual(234);
});
@@ -2142,14 +2142,14 @@ describe('parser', function() {
it('should evaluate function call without arguments', function() {
scope['const'] = function(a, b) {return 123;};
- expect(scope.$eval("const()")).toEqual(123);
+ expect(scope.$eval('const()')).toEqual(123);
});
it('should evaluate function call with arguments', function() {
scope.add = function(a, b) {
return a + b;
};
- expect(scope.$eval("add(1,2)")).toEqual(3);
+ expect(scope.$eval('add(1,2)')).toEqual(3);
});
it('should allow filter chains as arguments', function() {
@@ -2158,61 +2158,61 @@ describe('parser', function() {
};
scope.begin = 1;
scope.limit = 2;
- expect(scope.$eval("concat('abcd'|limitTo:limit:begin,'abcd'|limitTo:2:1|uppercase)")).toEqual("bcBC");
+ expect(scope.$eval('concat(\'abcd\'|limitTo:limit:begin,\'abcd\'|limitTo:2:1|uppercase)')).toEqual('bcBC');
});
it('should evaluate function call from a return value', function() {
scope.getter = function() { return function() { return 33; }; };
- expect(scope.$eval("getter()()")).toBe(33);
+ expect(scope.$eval('getter()()')).toBe(33);
});
// There is no "strict mode" in IE9
if (!msie || msie > 9) {
it('should set no context to functions returned by other functions', function() {
scope.getter = function() { return function() { expect(this).toBeUndefined(); }; };
- scope.$eval("getter()()");
+ scope.$eval('getter()()');
});
}
it('should evaluate multiplication and division', function() {
scope.taxRate = 8;
scope.subTotal = 100;
- expect(scope.$eval("taxRate / 100 * subTotal")).toEqual(8);
- expect(scope.$eval("subTotal * taxRate / 100")).toEqual(8);
+ expect(scope.$eval('taxRate / 100 * subTotal')).toEqual(8);
+ expect(scope.$eval('subTotal * taxRate / 100')).toEqual(8);
});
it('should evaluate array', function() {
- expect(scope.$eval("[]").length).toEqual(0);
- expect(scope.$eval("[1, 2]").length).toEqual(2);
- expect(scope.$eval("[1, 2]")[0]).toEqual(1);
- expect(scope.$eval("[1, 2]")[1]).toEqual(2);
- expect(scope.$eval("[1, 2,]")[1]).toEqual(2);
- expect(scope.$eval("[1, 2,]").length).toEqual(2);
+ expect(scope.$eval('[]').length).toEqual(0);
+ expect(scope.$eval('[1, 2]').length).toEqual(2);
+ expect(scope.$eval('[1, 2]')[0]).toEqual(1);
+ expect(scope.$eval('[1, 2]')[1]).toEqual(2);
+ expect(scope.$eval('[1, 2,]')[1]).toEqual(2);
+ expect(scope.$eval('[1, 2,]').length).toEqual(2);
});
it('should evaluate array access', function() {
- expect(scope.$eval("[1][0]")).toEqual(1);
- expect(scope.$eval("[[1]][0][0]")).toEqual(1);
- expect(scope.$eval("[].length")).toEqual(0);
- expect(scope.$eval("[1, 2].length")).toEqual(2);
+ expect(scope.$eval('[1][0]')).toEqual(1);
+ expect(scope.$eval('[[1]][0][0]')).toEqual(1);
+ expect(scope.$eval('[].length')).toEqual(0);
+ expect(scope.$eval('[1, 2].length')).toEqual(2);
});
it('should evaluate object', function() {
- expect(scope.$eval("{}")).toEqual({});
- expect(scope.$eval("{a:'b'}")).toEqual({a:"b"});
- expect(scope.$eval("{'a':'b'}")).toEqual({a:"b"});
- expect(scope.$eval("{\"a\":'b'}")).toEqual({a:"b"});
- expect(scope.$eval("{a:'b',}")).toEqual({a:"b"});
- expect(scope.$eval("{'a':'b',}")).toEqual({a:"b"});
- expect(scope.$eval("{\"a\":'b',}")).toEqual({a:"b"});
- expect(scope.$eval("{'0':1}")).toEqual({0:1});
- expect(scope.$eval("{0:1}")).toEqual({0:1});
- expect(scope.$eval("{1:1}")).toEqual({1:1});
- expect(scope.$eval("{null:1}")).toEqual({null:1});
- expect(scope.$eval("{'null':1}")).toEqual({null:1});
- expect(scope.$eval("{false:1}")).toEqual({false:1});
- expect(scope.$eval("{'false':1}")).toEqual({false:1});
- expect(scope.$eval("{'':1,}")).toEqual({"":1});
+ expect(scope.$eval('{}')).toEqual({});
+ expect(scope.$eval('{a:\'b\'}')).toEqual({a:'b'});
+ expect(scope.$eval('{\'a\':\'b\'}')).toEqual({a:'b'});
+ expect(scope.$eval('{"a":\'b\'}')).toEqual({a:'b'});
+ expect(scope.$eval('{a:\'b\',}')).toEqual({a:'b'});
+ expect(scope.$eval('{\'a\':\'b\',}')).toEqual({a:'b'});
+ expect(scope.$eval('{"a":\'b\',}')).toEqual({a:'b'});
+ expect(scope.$eval('{\'0\':1}')).toEqual({0:1});
+ expect(scope.$eval('{0:1}')).toEqual({0:1});
+ expect(scope.$eval('{1:1}')).toEqual({1:1});
+ expect(scope.$eval('{null:1}')).toEqual({null:1});
+ expect(scope.$eval('{\'null\':1}')).toEqual({null:1});
+ expect(scope.$eval('{false:1}')).toEqual({false:1});
+ expect(scope.$eval('{\'false\':1}')).toEqual({false:1});
+ expect(scope.$eval('{\'\':1,}')).toEqual({'':1});
// ES6 object initializers.
expect(scope.$eval('{x, y}', {x: 'foo', y: 'bar'})).toEqual({x: 'foo', y: 'bar'});
@@ -2223,28 +2223,28 @@ describe('parser', function() {
});
it('should throw syntax error exception for non constant/identifier JSON keys', function() {
- expect(function() { scope.$eval("{[:0}"); }).toThrowMinErr("$parse", "syntax",
- "Syntax Error: Token ':' not a primary expression at column 3 of the expression [{[:0}] starting at [:0}]");
- expect(function() { scope.$eval("{{:0}"); }).toThrowMinErr("$parse", "syntax",
- "Syntax Error: Token '{' invalid key at column 2 of the expression [{{:0}] starting at [{:0}]");
- expect(function() { scope.$eval("{?:0}"); }).toThrowMinErr("$parse", "syntax",
- "Syntax Error: Token '?' invalid key at column 2 of the expression [{?:0}] starting at [?:0}]");
- expect(function() { scope.$eval("{):0}"); }).toThrowMinErr("$parse", "syntax",
- "Syntax Error: Token ')' invalid key at column 2 of the expression [{):0}] starting at [):0}]");
+ expect(function() { scope.$eval('{[:0}'); }).toThrowMinErr('$parse', 'syntax',
+ 'Syntax Error: Token \':\' not a primary expression at column 3 of the expression [{[:0}] starting at [:0}]');
+ expect(function() { scope.$eval('{{:0}'); }).toThrowMinErr('$parse', 'syntax',
+ 'Syntax Error: Token \'{\' invalid key at column 2 of the expression [{{:0}] starting at [{:0}]');
+ expect(function() { scope.$eval('{?:0}'); }).toThrowMinErr('$parse', 'syntax',
+ 'Syntax Error: Token \'?\' invalid key at column 2 of the expression [{?:0}] starting at [?:0}]');
+ expect(function() { scope.$eval('{):0}'); }).toThrowMinErr('$parse', 'syntax',
+ 'Syntax Error: Token \')\' invalid key at column 2 of the expression [{):0}] starting at [):0}]');
});
it('should evaluate object access', function() {
- expect(scope.$eval("{false:'WC', true:'CC'}[false]")).toEqual("WC");
+ expect(scope.$eval('{false:\'WC\', true:\'CC\'}[false]')).toEqual('WC');
});
it('should evaluate JSON', function() {
- expect(scope.$eval("[{}]")).toEqual([{}]);
- expect(scope.$eval("[{a:[]}, {b:1}]")).toEqual([{a:[]}, {b:1}]);
+ expect(scope.$eval('[{}]')).toEqual([{}]);
+ expect(scope.$eval('[{a:[]}, {b:1}]')).toEqual([{a:[]}, {b:1}]);
});
it('should evaluate multiple statements', function() {
- expect(scope.$eval("a=1;b=3;a+b")).toEqual(4);
- expect(scope.$eval(";;1;;")).toEqual(1);
+ expect(scope.$eval('a=1;b=3;a+b')).toEqual(4);
+ expect(scope.$eval(';;1;;')).toEqual(1);
});
it('should evaluate object methods in correct context (this)', function() {
@@ -2256,8 +2256,8 @@ describe('parser', function() {
};
scope.obj = new C();
- expect(scope.$eval("obj.getA()")).toEqual(123);
- expect(scope.$eval("obj['getA']()")).toEqual(123);
+ expect(scope.$eval('obj.getA()')).toEqual(123);
+ expect(scope.$eval('obj[\'getA\']()')).toEqual(123);
});
it('should evaluate methods in correct context (this) in argument', function() {
@@ -2272,34 +2272,34 @@ describe('parser', function() {
};
scope.obj = new C();
- expect(scope.$eval("obj.sum(obj.getA())")).toEqual(246);
- expect(scope.$eval("obj['sum'](obj.getA())")).toEqual(246);
+ expect(scope.$eval('obj.sum(obj.getA())')).toEqual(246);
+ expect(scope.$eval('obj[\'sum\'](obj.getA())')).toEqual(246);
});
it('should evaluate objects on scope context', function() {
- scope.a = "abc";
- expect(scope.$eval("{a:a}").a).toEqual("abc");
+ scope.a = 'abc';
+ expect(scope.$eval('{a:a}').a).toEqual('abc');
});
it('should evaluate field access on function call result', function() {
scope.a = function() {
return {name:'misko'};
};
- expect(scope.$eval("a().name")).toEqual("misko");
+ expect(scope.$eval('a().name')).toEqual('misko');
});
it('should evaluate field access after array access', function() {
scope.items = [{}, {name:'misko'}];
- expect(scope.$eval('items[1].name')).toEqual("misko");
+ expect(scope.$eval('items[1].name')).toEqual('misko');
});
it('should evaluate array assignment', function() {
scope.items = [];
- expect(scope.$eval('items[1] = "abc"')).toEqual("abc");
- expect(scope.$eval('items[1]')).toEqual("abc");
- expect(scope.$eval('books[1] = "moby"')).toEqual("moby");
- expect(scope.$eval('books[1]')).toEqual("moby");
+ expect(scope.$eval('items[1] = "abc"')).toEqual('abc');
+ expect(scope.$eval('items[1]')).toEqual('abc');
+ expect(scope.$eval('books[1] = "moby"')).toEqual('moby');
+ expect(scope.$eval('books[1]')).toEqual('moby');
});
it('should evaluate grouped filters', function() {
@@ -2331,10 +2331,10 @@ describe('parser', function() {
});
it('should evaluate negation', function() {
- expect(scope.$eval("!false || true")).toEqual(!false || true);
+ expect(scope.$eval('!false || true')).toEqual(!false || true);
// eslint-disable-next-line eqeqeq
- expect(scope.$eval("!11 == 10")).toEqual(!11 == 10);
- expect(scope.$eval("12/6/2")).toEqual(12 / 6 / 2);
+ expect(scope.$eval('!11 == 10')).toEqual(!11 == 10);
+ expect(scope.$eval('12/6/2')).toEqual(12 / 6 / 2);
});
it('should evaluate exclamation mark', function() {
@@ -2342,12 +2342,12 @@ describe('parser', function() {
});
it('should evaluate minus', function() {
- expect(scope.$eval("{a:'-'}")).toEqual({a: "-"});
+ expect(scope.$eval('{a:\'-\'}')).toEqual({a: '-'});
});
it('should evaluate undefined', function() {
- expect(scope.$eval("undefined")).not.toBeDefined();
- expect(scope.$eval("a=undefined")).not.toBeDefined();
+ expect(scope.$eval('undefined')).not.toBeDefined();
+ expect(scope.$eval('a=undefined')).not.toBeDefined();
expect(scope.a).not.toBeDefined();
});
@@ -2360,7 +2360,7 @@ describe('parser', function() {
it('should short-circuit AND operator', function() {
scope.run = function() {
- throw new Error("IT SHOULD NOT HAVE RUN");
+ throw new Error('IT SHOULD NOT HAVE RUN');
};
expect(scope.$eval('false && run()')).toBe(false);
expect(scope.$eval('false && true && run()')).toBe(false);
@@ -2368,7 +2368,7 @@ describe('parser', function() {
it('should short-circuit OR operator', function() {
scope.run = function() {
- throw new Error("IT SHOULD NOT HAVE RUN");
+ throw new Error('IT SHOULD NOT HAVE RUN');
};
expect(scope.$eval('true || run()')).toBe(true);
expect(scope.$eval('true || false || run()')).toBe(true);
@@ -2399,26 +2399,26 @@ describe('parser', function() {
});
it('should evaluate expressions with line terminators', function() {
- scope.a = "a";
- scope.b = {c: "bc"};
- expect(scope.$eval('a + \n b.c + \r "\td" + \t \r\n\r "\r\n\n"')).toEqual("abc\td\r\n\n");
+ scope.a = 'a';
+ scope.b = {c: 'bc'};
+ expect(scope.$eval('a + \n b.c + \r "\td" + \t \r\n\r "\r\n\n"')).toEqual('abc\td\r\n\n');
});
// https://github.com/angular/angular.js/issues/10968
it('should evaluate arrays literals initializers left-to-right', inject(function($parse) {
var s = {c:function() {return {b: 1}; }};
- expect($parse("e=1;[a=c(),d=a.b+1]")(s)).toEqual([{b: 1}, 2]);
+ expect($parse('e=1;[a=c(),d=a.b+1]')(s)).toEqual([{b: 1}, 2]);
}));
it('should evaluate function arguments left-to-right', inject(function($parse) {
var s = {c:function() {return {b: 1}; }, i: function(x, y) { return [x, y];}};
- expect($parse("e=1;i(a=c(),d=a.b+1)")(s)).toEqual([{b: 1}, 2]);
+ expect($parse('e=1;i(a=c(),d=a.b+1)')(s)).toEqual([{b: 1}, 2]);
}));
it('should evaluate object properties expressions left-to-right', inject(function($parse) {
var s = {c:function() {return {b: 1}; }};
- expect($parse("e=1;{x: a=c(), y: d=a.b+1}")(s)).toEqual({x: {b: 1}, y: 2});
+ expect($parse('e=1;{x: a=c(), y: d=a.b+1}')(s)).toEqual({x: {b: 1}, y: 2});
}));
@@ -2462,8 +2462,8 @@ describe('parser', function() {
'$parse', 'isecfn', 'Referencing Function in Angular expressions is disallowed! ' +
'Expression: {}.toString["constructor"]["constructor"] = 1');
- scope.key1 = "const";
- scope.key2 = "ructor";
+ scope.key1 = 'const';
+ scope.key2 = 'ructor';
expect(function() {
scope.$eval('{}.toString[key1 + key2].foo = 1');
}).toThrowMinErr(
@@ -2523,7 +2523,7 @@ describe('parser', function() {
});
it('should NOT allow access to Function constructor that has been aliased in getters', function() {
- scope.foo = { "bar": Function };
+ scope.foo = { 'bar': Function };
expect(function() {
scope.$eval('foo["bar"]');
}).toThrowMinErr(
@@ -2532,7 +2532,7 @@ describe('parser', function() {
});
it('should NOT allow access to Function constructor that has been aliased in setters', function() {
- scope.foo = { "bar": Function };
+ scope.foo = { 'bar': Function };
expect(function() {
scope.$eval('foo["bar"] = 1');
}).toThrowMinErr(
@@ -2599,7 +2599,7 @@ describe('parser', function() {
scope.foo = {
w: $window,
bar: 'bar',
- e: function() { scope.$eval("foo.w && true"); },
+ e: function() { scope.$eval('foo.w && true'); },
f: function() {}
};
expect($parse.$$runningExpensiveChecks()).toEqual(false);
@@ -2691,7 +2691,7 @@ describe('parser', function() {
describe('Object constructor', function() {
it('should NOT allow access to Object constructor that has been aliased in getters', function() {
- scope.foo = { "bar": Object };
+ scope.foo = { 'bar': Object };
expect(function() {
scope.$eval('foo.bar.keys(foo)');
@@ -2707,7 +2707,7 @@ describe('parser', function() {
});
it('should NOT allow access to Object constructor that has been aliased in setters', function() {
- scope.foo = { "bar": Object };
+ scope.foo = { 'bar': Object };
expect(function() {
scope.$eval('foo.bar.keys(foo).bar = 1');
@@ -2818,8 +2818,8 @@ describe('parser', function() {
scope.$eval('{}["__defineGetter__"]("a", "".charAt)');
}).toThrowMinErr('$parse', 'isecfld');
- scope.a = "__define";
- scope.b = "Getter__";
+ scope.a = '__define';
+ scope.b = 'Getter__';
expect(function() {
scope.$eval('{}[a + b]');
}).toThrowMinErr('$parse', 'isecfld');
@@ -2843,8 +2843,8 @@ describe('parser', function() {
scope.$eval('{}["__defineSetter__"]("a", "".charAt)');
}).toThrowMinErr('$parse', 'isecfld');
- scope.a = "__define";
- scope.b = "Setter__";
+ scope.a = '__define';
+ scope.b = 'Setter__';
expect(function() {
scope.$eval('{}[a + b]');
}).toThrowMinErr('$parse', 'isecfld');
@@ -2868,8 +2868,8 @@ describe('parser', function() {
scope.$eval('{}["__lookupGetter__"]("a")');
}).toThrowMinErr('$parse', 'isecfld');
- scope.a = "__lookup";
- scope.b = "Getter__";
+ scope.a = '__lookup';
+ scope.b = 'Getter__';
expect(function() {
scope.$eval('{}[a + b]');
}).toThrowMinErr('$parse', 'isecfld');
@@ -2893,8 +2893,8 @@ describe('parser', function() {
scope.$eval('{}["__lookupSetter__"]("a")');
}).toThrowMinErr('$parse', 'isecfld');
- scope.a = "__lookup";
- scope.b = "Setter__";
+ scope.a = '__lookup';
+ scope.b = 'Setter__';
expect(function() {
scope.$eval('{}[a + b]');
}).toThrowMinErr('$parse', 'isecfld');
@@ -2935,8 +2935,8 @@ describe('parser', function() {
scope.$eval('0[["__proto__"]].foo = 1');
}).toThrowMinErr('$parse', 'isecfld');
- scope.a = "__pro";
- scope.b = "to__";
+ scope.a = '__pro';
+ scope.b = 'to__';
expect(function() {
scope.$eval('{}[a + b]');
}).toThrowMinErr('$parse', 'isecfld');
@@ -3200,7 +3200,7 @@ describe('parser', function() {
var count = 0;
scope.fn = function() {
count++;
- return { anotherFn: function() { return "lucas"; } };
+ return { anotherFn: function() { return 'lucas'; } };
};
expect(scope.$eval('fn().anotherFn()')).toBe('lucas');
expect(count).toBe(1);
@@ -3540,7 +3540,7 @@ describe('parser', function() {
var bCalled = 0;
scope.b = function() { bCalled++; };
- scope.$watch("a && b()");
+ scope.$watch('a && b()');
scope.$digest();
scope.$digest();
expect(bCalled).toBe(0);
@@ -3556,7 +3556,7 @@ describe('parser', function() {
var bCalled = false;
scope.b = function() { bCalled = true; };
- scope.$watch("a || b()");
+ scope.$watch('a || b()');
scope.$digest();
expect(bCalled).toBe(true);
@@ -3570,7 +3570,7 @@ describe('parser', function() {
var bCalled = false;
scope.b = function() { bCalled = true; };
- scope.$watch("a ? b() : 1");
+ scope.$watch('a ? b() : 1');
scope.$digest();
expect(bCalled).toBe(false);
@@ -3586,7 +3586,7 @@ describe('parser', function() {
return input;
}));
- scope.$watch("a | foo:b:1");
+ scope.$watch('a | foo:b:1');
scope.a = 0;
scope.$digest();
expect(filterCalled).toBe(true);
@@ -3607,7 +3607,7 @@ describe('parser', function() {
return input;
}, {$stateful: true})));
- scope.$watch("a | foo:b:1");
+ scope.$watch('a | foo:b:1');
scope.a = 0;
scope.$digest();
expect(filterCalled).toBe(true);
@@ -3623,8 +3623,8 @@ describe('parser', function() {
called = true;
return v;
}
- scope.$watch($parse("a", interceptor));
- scope.$watch($parse("a + b", interceptor));
+ scope.$watch($parse('a', interceptor));
+ scope.$watch($parse('a + b', interceptor));
scope.a = scope.b = 0;
scope.$digest();
expect(called).toBe(true);
@@ -3675,7 +3675,7 @@ describe('parser', function() {
expect(watcherCalls).toBe(1);
}));
- it("should always reevaluate filters with non-primitive input that doesn't support valueOf()",
+ it('should always reevaluate filters with non-primitive input that doesn\'t support valueOf()',
inject(function($parse) {
var filterCalls = 0;
$filterProvider.register('foo', valueFn(function(input) {
@@ -3701,7 +3701,7 @@ describe('parser', function() {
expect(watcherCalls).toBe(1);
}));
- it("should always reevaluate filters with non-primitive input created with null prototype",
+ it('should always reevaluate filters with non-primitive input created with null prototype',
inject(function($parse) {
var filterCalls = 0;
$filterProvider.register('foo', valueFn(function(input) {
@@ -3727,7 +3727,7 @@ describe('parser', function() {
expect(watcherCalls).toBe(1);
}));
- it("should not reevaluate filters with non-primitive input that does support valueOf()",
+ it('should not reevaluate filters with non-primitive input that does support valueOf()',
inject(function($parse) {
var filterCalls = 0;
$filterProvider.register('foo', valueFn(function(input) {
@@ -3754,8 +3754,8 @@ describe('parser', function() {
expect(watcherCalls).toBe(1);
}));
- it("should reevaluate filters with non-primitive input that does support valueOf() when" +
- "valueOf() value changes", inject(function($parse) {
+ it('should reevaluate filters with non-primitive input that does support valueOf() when' +
+ 'valueOf() value changes', inject(function($parse) {
var filterCalls = 0;
$filterProvider.register('foo', valueFn(function(input) {
filterCalls++;
@@ -3791,7 +3791,7 @@ describe('parser', function() {
}
interceptor.$stateful = true;
- scope.$watch($parse("a", interceptor));
+ scope.$watch($parse('a', interceptor));
scope.a = 0;
scope.$digest();
expect(called).toBe(true);
@@ -3813,7 +3813,7 @@ describe('parser', function() {
spy.and.callFake(function() { return value; });
scope.foo = spy;
- scope.$watch("foo() | uppercase");
+ scope.$watch('foo() | uppercase');
scope.$digest();
expect(spy).toHaveBeenCalledTimes(2);
scope.$digest();
@@ -3831,7 +3831,7 @@ describe('parser', function() {
scope.bar = 0;
scope.two = 2;
scope.foo = function() { if (scope.setBarToOne) scope.bar = 1; };
- scope.$watch("foo(); bar + two", listener);
+ scope.$watch('foo(); bar + two', listener);
scope.$digest();
expect(lastVal).toBe(2);
@@ -3852,7 +3852,7 @@ describe('parser', function() {
var objA = {};
var objB = {};
- scope.$watch("curObj.value = input", noop);
+ scope.$watch('curObj.value = input', noop);
scope.curObj = objA;
scope.input = 1;
@@ -3892,16 +3892,16 @@ describe('parser', function() {
it('should assign directly to locals when the local property exists', inject(function($parse) {
var s = {}, l = {};
- $parse("a = 1")(s, l);
+ $parse('a = 1')(s, l);
expect(s.a).toBe(1);
expect(l.a).toBeUndefined();
l.a = 2;
- $parse("a = 0")(s, l);
+ $parse('a = 0')(s, l);
expect(s.a).toBe(1);
expect(l.a).toBe(0);
- $parse("toString = 1")(s, l);
+ $parse('toString = 1')(s, l);
expect(isFunction(s.toString)).toBe(true);
expect(l.toString).toBe(1);
}));
@@ -4046,7 +4046,7 @@ describe('parser', function() {
}));
it('should treat properties named null/undefined as normal properties', inject(function($rootScope) {
- expect($rootScope.$eval("a.null.undefined.b", {a:{null:{undefined:{b: 1}}}})).toBe(1);
+ expect($rootScope.$eval('a.null.undefined.b', {a:{null:{undefined:{b: 1}}}})).toBe(1);
}));
it('should not allow overriding null/undefined keywords', inject(function($rootScope) {
diff --git a/test/ng/qSpec.js b/test/ng/qSpec.js
index d6fdc776ebdd..0175451dc5c7 100644
--- a/test/ng/qSpec.js
+++ b/test/ng/qSpec.js
@@ -650,7 +650,7 @@ describe('q', function() {
expect(logStr()).toBe('finally1()');
});
- describe("when the promise is fulfilled", function() {
+ describe('when the promise is fulfilled', function() {
it('should call the callback',
function() {
var promise = createPromise();
@@ -693,9 +693,9 @@ describe('q', function() {
'successCCCC(cc)->ccc']);
});
- describe("when the callback returns a promise", function() {
- describe("that is fulfilled", function() {
- it("should fulfill with the original reason after that promise resolves",
+ describe('when the callback returns a promise', function() {
+ describe('that is fulfilled', function() {
+ it('should fulfill with the original reason after that promise resolves',
function() {
var promise = createPromise();
var promise2 = createPromise();
@@ -711,8 +711,8 @@ describe('q', function() {
});
});
- describe("that is rejected", function() {
- it("should reject with this new rejection reason",
+ describe('that is rejected', function() {
+ it('should reject with this new rejection reason',
function() {
var promise = createPromise();
var promise2 = createPromise();
@@ -727,10 +727,10 @@ describe('q', function() {
});
- describe("when the callback throws an exception", function() {
- it("should reject with this new exception", function() {
+ describe('when the callback throws an exception', function() {
+ it('should reject with this new exception', function() {
var promise = createPromise();
- promise['finally'](fin(1, "exception", true))
+ promise['finally'](fin(1, 'exception', true))
.then(success(1), error(2));
resolve('foo');
mockNextTick.flush();
@@ -741,8 +741,8 @@ describe('q', function() {
});
- describe("when the promise is rejected", function() {
- it("should call the callback", function() {
+ describe('when the promise is rejected', function() {
+ it('should call the callback', function() {
var promise = createPromise();
promise['finally'](fin(1))
.then(success(2), error(1));
@@ -753,16 +753,16 @@ describe('q', function() {
it('should reject with the original reason', function() {
var promise = createPromise();
- promise['finally'](fin(1), "hello")
+ promise['finally'](fin(1), 'hello')
.then(success(2), error(2));
reject('original');
mockNextTick.flush();
expect(logStr()).toBe('finally1(); error2(original)->reject(original)');
});
- describe("when the callback returns a promise", function() {
- describe("that is fulfilled", function() {
- it("should reject with the original reason after that promise resolves", function() {
+ describe('when the callback returns a promise', function() {
+ describe('that is fulfilled', function() {
+ it('should reject with the original reason after that promise resolves', function() {
var promise = createPromise();
var promise2 = createPromise();
resolve2('bar');
@@ -774,8 +774,8 @@ describe('q', function() {
});
});
- describe("that is rejected", function() {
- it("should reject with the new reason", function() {
+ describe('that is rejected', function() {
+ it('should reject with the new reason', function() {
var promise = createPromise();
var promise2 = createPromise();
reject2('bar');
@@ -788,10 +788,10 @@ describe('q', function() {
});
});
- describe("when the callback throws an exception", function() {
- it("should reject with this new exception", function() {
+ describe('when the callback throws an exception', function() {
+ it('should reject with this new exception', function() {
var promise = createPromise();
- promise['finally'](fin(1, "exception", true))
+ promise['finally'](fin(1, 'exception', true))
.then(success(1), error(2));
resolve('foo');
mockNextTick.flush();
@@ -1126,7 +1126,7 @@ describe('q', function() {
});
- it("should not save and re-emit progress notifications between ticks", function() {
+ it('should not save and re-emit progress notifications between ticks', function() {
promise.then(success(1), error(1), progress(1));
deferred.notify('foo');
deferred.notify('bar');
@@ -1406,7 +1406,7 @@ describe('q', function() {
expect(logStr()).toBe('finally1()');
});
- describe("when the promise is fulfilled", function() {
+ describe('when the promise is fulfilled', function() {
it('should call the callback',
function() {
@@ -1444,10 +1444,10 @@ describe('q', function() {
'successCCCC(cc)->ccc']);
});
- describe("when the callback returns a promise", function() {
+ describe('when the callback returns a promise', function() {
- describe("that is fulfilled", function() {
- it("should fulfill with the original reason after that promise resolves",
+ describe('that is fulfilled', function() {
+ it('should fulfill with the original reason after that promise resolves',
function() {
var returnedDef = defer();
@@ -1462,8 +1462,8 @@ describe('q', function() {
});
});
- describe("that is rejected", function() {
- it("should reject with this new rejection reason",
+ describe('that is rejected', function() {
+ it('should reject with this new rejection reason',
function() {
var returnedDef = defer();
returnedDef.reject('bar');
@@ -1476,9 +1476,9 @@ describe('q', function() {
});
- describe("when the callback throws an exception", function() {
- it("should reject with this new exception", function() {
- promise['finally'](fin(1, "exception", true))
+ describe('when the callback throws an exception', function() {
+ it('should reject with this new exception', function() {
+ promise['finally'](fin(1, 'exception', true))
.then(success(1), error(2));
syncResolve(deferred, 'foo');
expect(logStr()).toBe('finally1()->throw(exception); error2(exception)->reject(exception)');
@@ -1488,9 +1488,9 @@ describe('q', function() {
});
- describe("when the promise is rejected", function() {
+ describe('when the promise is rejected', function() {
- it("should call the callback", function() {
+ it('should call the callback', function() {
promise['finally'](fin(1))
.then(success(2), error(1));
syncReject(deferred, 'foo');
@@ -1498,17 +1498,17 @@ describe('q', function() {
});
it('should reject with the original reason', function() {
- promise['finally'](fin(1), "hello")
+ promise['finally'](fin(1), 'hello')
.then(success(2), error(2));
syncReject(deferred, 'original');
expect(logStr()).toBe('finally1(); error2(original)->reject(original)');
});
- describe("when the callback returns a promise", function() {
+ describe('when the callback returns a promise', function() {
- describe("that is fulfilled", function() {
+ describe('that is fulfilled', function() {
- it("should reject with the original reason after that promise resolves", function() {
+ it('should reject with the original reason after that promise resolves', function() {
var returnedDef = defer();
returnedDef.resolve('bar');
promise['finally'](fin(1, returnedDef.promise))
@@ -1519,9 +1519,9 @@ describe('q', function() {
});
- describe("that is rejected", function() {
+ describe('that is rejected', function() {
- it("should reject with the new reason", function() {
+ it('should reject with the new reason', function() {
var returnedDef = defer();
returnedDef.reject('bar');
promise['finally'](fin(1, returnedDef.promise))
@@ -1534,10 +1534,10 @@ describe('q', function() {
});
- describe("when the callback throws an exception", function() {
+ describe('when the callback throws an exception', function() {
- it("should reject with this new exception", function() {
- promise['finally'](fin(1, "exception", true))
+ it('should reject with this new exception', function() {
+ promise['finally'](fin(1, 'exception', true))
.then(success(1), error(2));
syncResolve(deferred, 'foo');
expect(logStr()).toBe('finally1()->throw(exception); error2(exception)->reject(exception)');
diff --git a/test/ng/rafSpec.js b/test/ng/rafSpec.js
index 89b2cb30a787..e4b364cc8bbf 100644
--- a/test/ng/rafSpec.js
+++ b/test/ng/rafSpec.js
@@ -32,7 +32,7 @@ describe('$$rAF', function() {
}));
describe('$timeout fallback', function() {
- it("it should use a $timeout incase native rAF isn't suppored", function() {
+ it('it should use a $timeout incase native rAF isn\'t suppored', function() {
var timeoutSpy = jasmine.createSpy('callback');
//we need to create our own injector to work around the ngMock overrides
diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js
index 2184bd4fc9d6..93b8140f9356 100644
--- a/test/ng/rootScopeSpec.js
+++ b/test/ng/rootScopeSpec.js
@@ -90,7 +90,7 @@ describe('Scope', function() {
expect(child.$root).toBe($rootScope);
}));
- it("should attach the child scope to a specified parent", inject(function($rootScope) {
+ it('should attach the child scope to a specified parent', inject(function($rootScope) {
var isolated = $rootScope.$new(true);
var trans = $rootScope.$new(false, isolated);
$rootScope.a = 123;
@@ -681,11 +681,11 @@ describe('Scope', function() {
it('should trigger when property changes into array', function() {
$rootScope.obj = 'test';
$rootScope.$digest();
- expect(log.empty()).toEqual([{newVal: "test", oldVal: "test", identical: true}]);
+ expect(log.empty()).toEqual([{newVal: 'test', oldVal: 'test', identical: true}]);
$rootScope.obj = [];
$rootScope.$digest();
- expect(log.empty()).toEqual([{newVal: [], oldVal: "test"}]);
+ expect(log.empty()).toEqual([{newVal: [], oldVal: 'test'}]);
$rootScope.obj = {};
$rootScope.$digest();
@@ -755,10 +755,10 @@ describe('Scope', function() {
arrayLikelog.push(element.name);
});
});
- window.document.body.innerHTML = "" +
- "a " +
- "b " +
- "
";
+ window.document.body.innerHTML = '' +
+ 'a ' +
+ 'b ' +
+ '
';
$rootScope.arrayLikeObject = window.document.getElementsByTagName('a');
$rootScope.$digest();
@@ -1159,7 +1159,7 @@ describe('Scope', function() {
}));
- it("should do nothing when a child event listener is registered after parent's destruction",
+ it('should do nothing when a child event listener is registered after parent\'s destruction',
inject(function($rootScope) {
var parent = $rootScope.$new(),
child = parent.$new();
@@ -1170,7 +1170,7 @@ describe('Scope', function() {
}));
- it("should do nothing when a child watch is registered after parent's destruction",
+ it('should do nothing when a child watch is registered after parent\'s destruction',
inject(function($rootScope) {
var parent = $rootScope.$new(),
child = parent.$new();
@@ -1180,7 +1180,7 @@ describe('Scope', function() {
expect(fn).toBe(noop);
}));
- it("should do nothing when $apply()ing after parent's destruction", inject(function($rootScope) {
+ it('should do nothing when $apply()ing after parent\'s destruction', inject(function($rootScope) {
var parent = $rootScope.$new(),
child = parent.$new();
@@ -1193,7 +1193,7 @@ describe('Scope', function() {
expect(called).toBe(false);
}));
- it("should do nothing when $evalAsync()ing after parent's destruction", inject(function($rootScope, $timeout) {
+ it('should do nothing when $evalAsync()ing after parent\'s destruction', inject(function($rootScope, $timeout) {
var parent = $rootScope.$new(),
child = parent.$new();
@@ -1208,7 +1208,7 @@ describe('Scope', function() {
}));
- it("should preserve all (own and inherited) model properties on a destroyed scope",
+ it('should preserve all (own and inherited) model properties on a destroyed scope',
inject(function($rootScope) {
// This test simulates an async task (xhr response) interacting with the scope after the scope
// was destroyed. Since we can't abort the request, we should ensure that the task doesn't
@@ -1324,7 +1324,7 @@ describe('Scope', function() {
$rootScope.log = '';
$rootScope.value = 0;
$rootScope.$watch('value', function() {
- $rootScope.log = $rootScope.log + ".";
+ $rootScope.log = $rootScope.log + '.';
});
$rootScope.$watch('init', function() {
$rootScope.$evalAsync('value = 123; log = log + "=" ');
@@ -1336,8 +1336,8 @@ describe('Scope', function() {
it('should run async in the same order as added', inject(function($rootScope) {
$rootScope.log = '';
- $rootScope.$evalAsync("log = log + 1");
- $rootScope.$evalAsync("log = log + 2");
+ $rootScope.$evalAsync('log = log + 1');
+ $rootScope.$evalAsync('log = log + 2');
$rootScope.$digest();
expect($rootScope.log).toBe('12');
}));
@@ -2179,7 +2179,7 @@ describe('Scope', function() {
}));
- it("should have the event's `currentScope` property set to null after broadcast",
+ it('should have the event\'s `currentScope` property set to null after broadcast',
inject(function($rootScope) {
var scope = $rootScope,
child = scope.$new(),
@@ -2213,9 +2213,9 @@ describe('Scope', function() {
});
});
- describe("doc examples", function() {
+ describe('doc examples', function() {
- it("should properly fire off watch listeners upon scope changes", inject(function($rootScope) {
+ it('should properly fire off watch listeners upon scope changes', inject(function($rootScope) {
//
var scope = $rootScope.$new();
scope.salutation = 'Hello';
diff --git a/test/ng/sanitizeUriSpec.js b/test/ng/sanitizeUriSpec.js
index a64b7dd4487f..7d01e3c4ba64 100644
--- a/test/ng/sanitizeUriSpec.js
+++ b/test/ng/sanitizeUriSpec.js
@@ -27,51 +27,51 @@ describe('sanitizeUri', function() {
describe('img[src] sanitization', function() {
it('should sanitize javascript: urls', function() {
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeImg(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
});
it('should sanitize javascript: urls with comments', function() {
- testUrl = "javascript:alert(1)//data:image/";
+ testUrl = 'javascript:alert(1)//data:image/';
expect(sanitizeImg(testUrl)).toBe('unsafe:javascript:alert(1)//data:image/');
});
it('should sanitize non-image data: urls', function() {
- testUrl = "data:application/javascript;charset=US-ASCII,alert('evil!');";
- expect(sanitizeImg(testUrl)).toBe("unsafe:data:application/javascript;charset=US-ASCII,alert('evil!');");
+ testUrl = 'data:application/javascript;charset=US-ASCII,alert(\'evil!\');';
+ expect(sanitizeImg(testUrl)).toBe('unsafe:data:application/javascript;charset=US-ASCII,alert(\'evil!\');');
- testUrl = "data:,foo";
- expect(sanitizeImg(testUrl)).toBe("unsafe:data:,foo");
+ testUrl = 'data:,foo';
+ expect(sanitizeImg(testUrl)).toBe('unsafe:data:,foo');
});
it('should sanitize mailto: urls', function() {
- testUrl = "mailto:foo@bar.com";
+ testUrl = 'mailto:foo@bar.com';
expect(sanitizeImg(testUrl)).toBe('unsafe:mailto:foo@bar.com');
});
it('should sanitize obfuscated javascript: urls', function() {
// case-sensitive
- testUrl = "JaVaScRiPt:doEvilStuff()";
+ testUrl = 'JaVaScRiPt:doEvilStuff()';
expect(sanitizeImg(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
// tab in protocol
- testUrl = "java\u0009script:doEvilStuff()";
+ testUrl = 'java\u0009script:doEvilStuff()';
if (isEvilInCurrentBrowser(testUrl)) {
expect(sanitizeImg(testUrl)).toEqual('unsafe:javascript:doEvilStuff()');
}
// space before
- testUrl = " javascript:doEvilStuff()";
+ testUrl = ' javascript:doEvilStuff()';
expect(sanitizeImg(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
// ws chars before
- testUrl = " \u000e javascript:doEvilStuff()";
+ testUrl = ' \u000e javascript:doEvilStuff()';
if (isEvilInCurrentBrowser(testUrl)) {
expect(sanitizeImg(testUrl)).toEqual('unsafe:javascript:doEvilStuff()');
}
// post-fixed with proper url
- testUrl = "javascript:doEvilStuff(); http://make.me/look/good";
+ testUrl = 'javascript:doEvilStuff(); http://make.me/look/good';
expect(sanitizeImg(testUrl)).toBeOneOf(
'unsafe:javascript:doEvilStuff(); http://make.me/look/good',
'unsafe:javascript:doEvilStuff();%20http://make.me/look/good'
@@ -79,49 +79,49 @@ describe('sanitizeUri', function() {
});
it('should sanitize ng-src bindings as well', function() {
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeImg(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
});
it('should not sanitize valid urls', function() {
- testUrl = "foo/bar";
+ testUrl = 'foo/bar';
expect(sanitizeImg(testUrl)).toBe('foo/bar');
- testUrl = "/foo/bar";
+ testUrl = '/foo/bar';
expect(sanitizeImg(testUrl)).toBe('/foo/bar');
- testUrl = "../foo/bar";
+ testUrl = '../foo/bar';
expect(sanitizeImg(testUrl)).toBe('../foo/bar');
- testUrl = "#foo";
+ testUrl = '#foo';
expect(sanitizeImg(testUrl)).toBe('#foo');
- testUrl = "http://foo.com/bar";
+ testUrl = 'http://foo.com/bar';
expect(sanitizeImg(testUrl)).toBe('http://foo.com/bar');
- testUrl = " http://foo.com/bar";
+ testUrl = ' http://foo.com/bar';
expect(sanitizeImg(testUrl)).toBe(' http://foo.com/bar');
- testUrl = "https://foo.com/bar";
+ testUrl = 'https://foo.com/bar';
expect(sanitizeImg(testUrl)).toBe('https://foo.com/bar');
- testUrl = "ftp://foo.com/bar";
+ testUrl = 'ftp://foo.com/bar';
expect(sanitizeImg(testUrl)).toBe('ftp://foo.com/bar');
- testUrl = "file:///foo/bar.html";
+ testUrl = 'file:///foo/bar.html';
expect(sanitizeImg(testUrl)).toBe('file:///foo/bar.html');
});
it('should not sanitize blob urls', function() {
- testUrl = "blob:///foo/bar.html";
+ testUrl = 'blob:///foo/bar.html';
expect(sanitizeImg(testUrl)).toBe('blob:///foo/bar.html');
});
it('should not sanitize data: URIs for images', function() {
// image data uri
// ref: http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
- testUrl = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
+ testUrl = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
expect(sanitizeImg(testUrl)).toBe('data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
});
@@ -131,10 +131,10 @@ describe('sanitizeUri', function() {
returnVal = sanitizeUriProvider.imgSrcSanitizationWhitelist(/javascript:/);
expect(returnVal).toBe(sanitizeUriProvider);
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeImg(testUrl)).toBe('javascript:doEvilStuff()');
- testUrl = "http://recon/figured";
+ testUrl = 'http://recon/figured';
expect(sanitizeImg(testUrl)).toBe('unsafe:http://recon/figured');
});
@@ -144,40 +144,40 @@ describe('sanitizeUri', function() {
describe('a[href] sanitization', function() {
it('should sanitize javascript: urls', inject(function() {
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeHref(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
}));
it('should sanitize data: urls', inject(function() {
- testUrl = "data:evilPayload";
+ testUrl = 'data:evilPayload';
expect(sanitizeHref(testUrl)).toBe('unsafe:data:evilPayload');
}));
it('should sanitize obfuscated javascript: urls', inject(function() {
// case-sensitive
- testUrl = "JaVaScRiPt:doEvilStuff()";
+ testUrl = 'JaVaScRiPt:doEvilStuff()';
expect(sanitizeHref(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
// tab in protocol
- testUrl = "java\u0009script:doEvilStuff()";
+ testUrl = 'java\u0009script:doEvilStuff()';
if (isEvilInCurrentBrowser(testUrl)) {
expect(sanitizeHref(testUrl)).toEqual('unsafe:javascript:doEvilStuff()');
}
// space before
- testUrl = " javascript:doEvilStuff()";
+ testUrl = ' javascript:doEvilStuff()';
expect(sanitizeHref(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
// ws chars before
- testUrl = " \u000e javascript:doEvilStuff()";
+ testUrl = ' \u000e javascript:doEvilStuff()';
if (isEvilInCurrentBrowser(testUrl)) {
expect(sanitizeHref(testUrl)).toEqual('unsafe:javascript:doEvilStuff()');
}
// post-fixed with proper url
- testUrl = "javascript:doEvilStuff(); http://make.me/look/good";
+ testUrl = 'javascript:doEvilStuff(); http://make.me/look/good';
expect(sanitizeHref(testUrl)).toBeOneOf(
'unsafe:javascript:doEvilStuff(); http://make.me/look/good',
'unsafe:javascript:doEvilStuff();%20http://make.me/look/good'
@@ -186,40 +186,40 @@ describe('sanitizeUri', function() {
it('should sanitize ngHref bindings as well', inject(function() {
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeHref(testUrl)).toBe('unsafe:javascript:doEvilStuff()');
}));
it('should not sanitize valid urls', inject(function() {
- testUrl = "foo/bar";
+ testUrl = 'foo/bar';
expect(sanitizeHref(testUrl)).toBe('foo/bar');
- testUrl = "/foo/bar";
+ testUrl = '/foo/bar';
expect(sanitizeHref(testUrl)).toBe('/foo/bar');
- testUrl = "../foo/bar";
+ testUrl = '../foo/bar';
expect(sanitizeHref(testUrl)).toBe('../foo/bar');
- testUrl = "#foo";
+ testUrl = '#foo';
expect(sanitizeHref(testUrl)).toBe('#foo');
- testUrl = "http://foo/bar";
+ testUrl = 'http://foo/bar';
expect(sanitizeHref(testUrl)).toBe('http://foo/bar');
- testUrl = " http://foo/bar";
+ testUrl = ' http://foo/bar';
expect(sanitizeHref(testUrl)).toBe(' http://foo/bar');
- testUrl = "https://foo/bar";
+ testUrl = 'https://foo/bar';
expect(sanitizeHref(testUrl)).toBe('https://foo/bar');
- testUrl = "ftp://foo/bar";
+ testUrl = 'ftp://foo/bar';
expect(sanitizeHref(testUrl)).toBe('ftp://foo/bar');
- testUrl = "mailto:foo@bar.com";
+ testUrl = 'mailto:foo@bar.com';
expect(sanitizeHref(testUrl)).toBe('mailto:foo@bar.com');
- testUrl = "file:///foo/bar.html";
+ testUrl = 'file:///foo/bar.html';
expect(sanitizeHref(testUrl)).toBe('file:///foo/bar.html');
}));
@@ -229,10 +229,10 @@ describe('sanitizeUri', function() {
returnVal = sanitizeUriProvider.aHrefSanitizationWhitelist(/javascript:/);
expect(returnVal).toBe(sanitizeUriProvider);
- testUrl = "javascript:doEvilStuff()";
+ testUrl = 'javascript:doEvilStuff()';
expect(sanitizeHref(testUrl)).toBe('javascript:doEvilStuff()');
- testUrl = "http://recon/figured";
+ testUrl = 'http://recon/figured';
expect(sanitizeHref(testUrl)).toBe('unsafe:http://recon/figured');
});
diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js
index 3da311a05353..a5aeea7afe09 100644
--- a/test/ng/sceSpecs.js
+++ b/test/ng/sceSpecs.js
@@ -14,7 +14,7 @@ describe('SCE', function() {
}));
it('should not wrap/unwrap any value or throw exception on non-string values', inject(function($sce) {
- var originalValue = { foo: "bar" };
+ var originalValue = { foo: 'bar' };
expect($sce.trustAs($sce.JS, originalValue)).toBe(originalValue);
expect($sce.getTrusted($sce.JS, originalValue)).toBe(originalValue);
}));
@@ -138,21 +138,21 @@ describe('SCE', function() {
}));
it('should wrap "" into ""', inject(function($sce) {
- expect($sce.trustAsHtml("")).toBe("");
+ expect($sce.trustAsHtml('')).toBe('');
}));
it('should unwrap "" into ""', inject(function($sce) {
- expect($sce.getTrusted($sce.HTML, "")).toBe("");
+ expect($sce.getTrusted($sce.HTML, '')).toBe('');
}));
it('should unwrap values and return the original', inject(function($sce) {
- var originalValue = "originalValue";
+ var originalValue = 'originalValue';
var wrappedValue = $sce.trustAs($sce.HTML, originalValue);
expect($sce.getTrusted($sce.HTML, wrappedValue)).toBe(originalValue);
}));
it('should NOT unwrap values when the type is different', inject(function($sce) {
- var originalValue = "originalValue";
+ var originalValue = 'originalValue';
var wrappedValue = $sce.trustAs($sce.HTML, originalValue);
expect(function() { $sce.getTrusted($sce.CSS, wrappedValue); }).toThrowMinErr(
'$sce', 'unsafe', 'Attempting to use an unsafe value in a safe context.');
@@ -164,7 +164,7 @@ describe('SCE', function() {
return trustedValue;
};
}
- var wrappedValue = new TrustedValueHolder("originalValue");
+ var wrappedValue = new TrustedValueHolder('originalValue');
expect(function() { return $sce.getTrusted($sce.HTML, wrappedValue); }).toThrowMinErr(
'$sce', 'unsafe', 'Attempting to use an unsafe value in a safe context.');
}));
@@ -182,17 +182,17 @@ describe('SCE', function() {
it('should override the default $sce.trustAs/valueOf/etc.', function() {
module(function($provide) {
$provide.value('$sceDelegate', {
- trustAs: function(type, value) { return "wrapped:" + value; },
- getTrusted: function(type, value) { return "unwrapped:" + value; },
- valueOf: function(value) { return "valueOf:" + value; }
+ trustAs: function(type, value) { return 'wrapped:' + value; },
+ getTrusted: function(type, value) { return 'unwrapped:' + value; },
+ valueOf: function(value) { return 'valueOf:' + value; }
});
});
inject(function($sce) {
- expect($sce.trustAsJs("value")).toBe("wrapped:value");
- expect($sce.valueOf("value")).toBe("valueOf:value");
- expect($sce.getTrustedJs("value")).toBe("unwrapped:value");
- expect($sce.parseAsJs("name")({name: "chirayu"})).toBe("unwrapped:chirayu");
+ expect($sce.trustAsJs('value')).toBe('wrapped:value');
+ expect($sce.valueOf('value')).toBe('valueOf:value');
+ expect($sce.getTrustedJs('value')).toBe('unwrapped:value');
+ expect($sce.parseAsJs('name')({name: 'chirayu'})).toBe('unwrapped:chirayu');
});
});
});
@@ -208,7 +208,7 @@ describe('SCE', function() {
expect($sce.parseAsJs('false')()).toBe(false);
expect($sce.parseAsJs('null')()).toBe(null);
expect($sce.parseAsJs('undefined')()).toBeUndefined();
- expect($sce.parseAsJs('"string"')()).toBe("string");
+ expect($sce.parseAsJs('"string"')()).toBe('string');
}));
it('should be possible to do one-time binding', function() {
diff --git a/test/ng/timeoutSpec.js b/test/ng/timeoutSpec.js
index 0ca76b4b3ffb..f82905fc1668 100644
--- a/test/ng/timeoutSpec.js
+++ b/test/ng/timeoutSpec.js
@@ -161,11 +161,11 @@ describe('$timeout', function() {
it('should delegate exception to the $exceptionHandler service', inject(
function($timeout, $exceptionHandler) {
- $timeout(function() { throw "Test Error"; });
+ $timeout(function() { throw 'Test Error'; });
expect($exceptionHandler.errors).toEqual([]);
$timeout.flush();
- expect($exceptionHandler.errors).toEqual(["Test Error", 'Possibly unhandled rejection: Test Error']);
+ expect($exceptionHandler.errors).toEqual(['Test Error', 'Possibly unhandled rejection: Test Error']);
}));
@@ -173,7 +173,7 @@ describe('$timeout', function() {
function($timeout, $rootScope) {
var applySpy = spyOn($rootScope, '$apply').and.callThrough();
- $timeout(function() { throw "Test Error"; });
+ $timeout(function() { throw 'Test Error'; });
expect(applySpy).not.toHaveBeenCalled();
$timeout.flush();
@@ -183,7 +183,7 @@ describe('$timeout', function() {
it('should reject the timeout promise when an exception is thrown in the timeout callback',
inject(function($timeout, log) {
- var promise = $timeout(function() { throw "Some Error"; });
+ var promise = $timeout(function() { throw 'Some Error'; });
promise.then(log.fn('success'), function(reason) { log('error: ' + reason); });
$timeout.flush();
@@ -216,7 +216,7 @@ describe('$timeout', function() {
// $browser.defer.cancel is only called on cancel if the deferred object is still referenced
var cancelSpy = spyOn($browser.defer, 'cancel').and.callThrough();
- var promise = $timeout(function() { throw "Test Error"; }, 0, false);
+ var promise = $timeout(function() { throw 'Test Error'; }, 0, false);
$timeout.flush();
expect(cancelSpy).not.toHaveBeenCalled();
diff --git a/test/ng/urlUtilsSpec.js b/test/ng/urlUtilsSpec.js
index cd2519d98452..c1d24fe645d4 100644
--- a/test/ng/urlUtilsSpec.js
+++ b/test/ng/urlUtilsSpec.js
@@ -3,16 +3,16 @@
describe('urlUtils', function() {
describe('urlResolve', function() {
it('should normalize a relative url', function() {
- expect(urlResolve("foo").href).toMatch(/^https?:\/\/[^/]+\/foo$/);
+ expect(urlResolve('foo').href).toMatch(/^https?:\/\/[^/]+\/foo$/);
});
it('should parse relative URL into component pieces', function() {
- var parsed = urlResolve("foo");
+ var parsed = urlResolve('foo');
expect(parsed.href).toMatch(/https?:\/\//);
expect(parsed.protocol).toMatch(/^https?/);
- expect(parsed.host).not.toBe("");
- expect(parsed.hostname).not.toBe("");
- expect(parsed.pathname).not.toBe("");
+ expect(parsed.host).not.toBe('');
+ expect(parsed.hostname).not.toBe('');
+ expect(parsed.pathname).not.toBe('');
});
diff --git a/test/ng/windowSpec.js b/test/ng/windowSpec.js
index 97edd02e859f..7b822bc0d8fd 100644
--- a/test/ng/windowSpec.js
+++ b/test/ng/windowSpec.js
@@ -1,7 +1,7 @@
'use strict';
describe('$window', function() {
- it("should inject $window", inject(function($window) {
+ it('should inject $window', inject(function($window) {
expect($window).toBe(window);
}));
diff --git a/test/ngAnimate/animateCssDriverSpec.js b/test/ngAnimate/animateCssDriverSpec.js
index 0f44cb440203..619088cd4765 100644
--- a/test/ngAnimate/animateCssDriverSpec.js
+++ b/test/ngAnimate/animateCssDriverSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ngAnimate $$animateCssDriver", function() {
+describe('ngAnimate $$animateCssDriver', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
@@ -89,18 +89,18 @@ describe("ngAnimate $$animateCssDriver", function() {
expect($animateProvider.drivers).toContain('$$animateCssDriver');
}));
- describe("regular animations", function() {
- it("should render an animation on the given element", inject(function() {
+ describe('regular animations', function() {
+ it('should render an animation on the given element', inject(function() {
driver({ element: element });
expect(capturedAnimation[0]).toBe(element);
}));
- it("should return an object with a start function", inject(function() {
+ it('should return an object with a start function', inject(function() {
var runner = driver({ element: element });
expect(isFunction(runner.start)).toBeTruthy();
}));
- it("should not signal $animateCss to apply the classes early when animation is structural", inject(function() {
+ it('should not signal $animateCss to apply the classes early when animation is structural', inject(function() {
driver({ element: element });
expect(capturedAnimation[1].applyClassesEarly).toBeFalsy();
@@ -108,7 +108,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(capturedAnimation[1].applyClassesEarly).toBeTruthy();
}));
- it("should only set the event value if the animation is structural", inject(function() {
+ it('should only set the event value if the animation is structural', inject(function() {
driver({ element: element, structural: true, event: 'superman' });
expect(capturedAnimation[1].event).toBe('superman');
@@ -117,7 +117,7 @@ describe("ngAnimate $$animateCssDriver", function() {
}));
});
- describe("anchored animations", function() {
+ describe('anchored animations', function() {
var from, to, fromAnimation, toAnimation;
beforeEach(module(function() {
@@ -140,7 +140,7 @@ describe("ngAnimate $$animateCssDriver", function() {
};
}));
- it("should not return anything if no animation is detected", function() {
+ it('should not return anything if no animation is detected', function() {
module(function($provide) {
$provide.value('$animateCss', function() {
return { $$willAnimate: false };
@@ -155,7 +155,7 @@ describe("ngAnimate $$animateCssDriver", function() {
});
});
- it("should return a start method", inject(function() {
+ it('should return a start method', inject(function() {
var animator = driver({
from: fromAnimation,
to: toAnimation
@@ -163,7 +163,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(isFunction(animator.start)).toBeTruthy();
}));
- they("should return a runner with a $prop() method which will end the animation",
+ they('should return a runner with a $prop() method which will end the animation',
['end', 'cancel'], function(method) {
var closeAnimation;
@@ -203,7 +203,7 @@ describe("ngAnimate $$animateCssDriver", function() {
});
});
- it("should end the animation for each of the from and to elements as well as all the anchors", function() {
+ it('should end the animation for each of the from and to elements as well as all the anchors', function() {
var closeLog = {};
module(function($provide) {
$provide.factory('$animateCss', function($q, $$AnimateRunner) {
@@ -255,7 +255,7 @@ describe("ngAnimate $$animateCssDriver", function() {
});
});
- it("should render an animation on both the from and to elements", inject(function() {
+ it('should render an animation on both the from and to elements', inject(function() {
captureFn = function(element, details) {
element.addClass(details.event);
};
@@ -273,7 +273,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(toAnimation.element).toHaveClass('leave');
}));
- it("should start the animations on the from and to elements in parallel", function() {
+ it('should start the animations on the from and to elements in parallel', function() {
var animationLog = [];
module(function($provide) {
$provide.factory('$animateCss', function($$AnimateRunner) {
@@ -306,7 +306,7 @@ describe("ngAnimate $$animateCssDriver", function() {
});
});
- it("should start an animation for each anchor", inject(function() {
+ it('should start an animation for each anchor', inject(function() {
var o1 = jqLite('
');
from.append(o1);
var o2 = jqLite('
');
@@ -336,7 +336,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(captureLog.length).toBe(5);
}));
- it("should create a clone of the starting element for each anchor animation", inject(function() {
+ it('should create a clone of the starting element for each anchor animation', inject(function() {
var o1 = jqLite('
');
from.append(o1);
var o2 = jqLite('
');
@@ -367,7 +367,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(a2.attr('class')).toMatch(/\bout2\b/);
}));
- it("should create a clone of the starting element and place it at the end of the $rootElement container",
+ it('should create a clone of the starting element and place it at the end of the $rootElement container',
inject(function($rootElement) {
//stick some garbage into the rootElement
@@ -397,7 +397,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(contents[contents.length - 1]).toEqual(anchorNode);
}));
- it("should first do an addClass('ng-anchor-out') animation on the cloned anchor", inject(function($rootElement) {
+ it('should first do an addClass(\'ng-anchor-out\') animation on the cloned anchor', inject(function($rootElement) {
var fromAnchor = jqLite('
');
from.append(fromAnchor);
var toAnchor = jqLite('
');
@@ -420,7 +420,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(anchorDetails.event).toBeFalsy();
}));
- it("should then do an addClass('ng-anchor-in') animation on the cloned anchor and remove the old class",
+ it('should then do an addClass(\'ng-anchor-in\') animation on the cloned anchor and remove the old class',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -448,7 +448,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(anchorDetails.event).toBeFalsy();
}));
- they("should only fire the ng-anchor-$prop animation if only a $prop animation is defined",
+ they('should only fire the ng-anchor-$prop animation if only a $prop animation is defined',
['out', 'in'], function(direction) {
var expectedClass = 'ng-anchor-' + direction;
@@ -501,7 +501,7 @@ describe("ngAnimate $$animateCssDriver", function() {
});
- it("should provide an explicit delay setting in the options provided to $animateCss for anchor animations",
+ it('should provide an explicit delay setting in the options provided to $animateCss for anchor animations',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -524,7 +524,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(capturedAnimation[1].delay).toBeTruthy();
}));
- it("should begin the anchor animation by seeding the from styles based on where the from anchor element is positioned",
+ it('should begin the anchor animation by seeding the from styles based on where the from anchor element is positioned',
inject(function($rootElement) {
ss.addRule('.starting-element', 'width:200px; height:100px; display:block;');
@@ -559,7 +559,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(int(fromStyles.left)).toBeGreaterThan(149);
}));
- it("should append a `px` value for all seeded animation styles", inject(function($rootElement) {
+ it('should append a `px` value for all seeded animation styles', inject(function($rootElement) {
ss.addRule('.starting-element', 'width:10px; height:20px; display:inline-block;');
var fromAnchor = jqLite('
');
@@ -627,7 +627,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(anchorDetails.event).toBeFalsy();
}));
- it("should add the `ng-anchor` class to the cloned anchor element",
+ it('should add the `ng-anchor` class to the cloned anchor element',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -651,7 +651,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(clonedAnchor).toHaveClass('ng-anchor');
}));
- it("should add and remove the `ng-animate-shim` class on the in anchor element during the animation",
+ it('should add and remove the `ng-animate-shim` class on the in anchor element during the animation',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -680,7 +680,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(fromAnchor).not.toHaveClass('ng-animate-shim');
}));
- it("should add and remove the `ng-animate-shim` class on the out anchor element during the animation",
+ it('should add and remove the `ng-animate-shim` class on the out anchor element during the animation',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -711,7 +711,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(toAnchor).not.toHaveClass('ng-animate-shim');
}));
- it("should create the cloned anchor with all of the classes from the from anchor element",
+ it('should create the cloned anchor with all of the classes from the from anchor element',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -735,7 +735,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(hasAll(addedClasses, ['yes', 'no', 'maybe'])).toBe(true);
}));
- it("should remove the classes of the starting anchor from the cloned anchor node during the in animation and also add the classes of the destination anchor within the same animation",
+ it('should remove the classes of the starting anchor from the cloned anchor node during the in animation and also add the classes of the destination anchor within the same animation',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -766,7 +766,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(hasAll(addedClasses, ['why', 'ok', 'so-what'])).toBe(true);
}));
- it("should not attempt to add/remove any classes that contain a `ng-` prefix",
+ it('should not attempt to add/remove any classes that contain a `ng-` prefix',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -802,7 +802,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(removedClasses).not.toContain('ng-no');
}));
- it("should not remove any shared CSS classes between the starting and destination anchor element during the in animation",
+ it('should not remove any shared CSS classes between the starting and destination anchor element during the in animation',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -850,7 +850,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(clonedAnchor).toHaveClass('blue');
}));
- it("should continue the anchor animation by seeding the to styles based on where the final anchor element will be positioned",
+ it('should continue the anchor animation by seeding the to styles based on where the final anchor element will be positioned',
inject(function($rootElement) {
ss.addRule('.ending-element', 'width:9999px; height:6666px; display:inline-block;');
@@ -887,7 +887,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(int(toStyles.left)).toBeGreaterThan(20);
}));
- it("should remove the cloned anchor node from the DOM once the 'in' animation is complete",
+ it('should remove the cloned anchor node from the DOM once the \'in\' animation is complete',
inject(function($rootElement) {
var fromAnchor = jqLite('
');
@@ -920,7 +920,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(clonedAnchor.parent().length).toBe(0);
}));
- it("should pass the provided domOperation into $animateCss to be run right after the element is animated if a leave animation is present",
+ it('should pass the provided domOperation into $animateCss to be run right after the element is animated if a leave animation is present',
inject(function($rootElement) {
toAnimation.structural = true;
@@ -946,7 +946,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(enterAnimation.args[1].onDone).toBeUndefined();
}));
- it("should fire the returned runner promise when the from, to and anchor animations are all complete",
+ it('should fire the returned runner promise when the from, to and anchor animations are all complete',
inject(function($rootElement, $rootScope, $animate) {
ss.addRule('.ending-element', 'width:9999px; height:6666px; display:inline-block;');
@@ -983,7 +983,7 @@ describe("ngAnimate $$animateCssDriver", function() {
expect(completed).toBe(true);
}));
- it("should use as the element container if the rootElement exists outside of the tag", function() {
+ it('should use as the element container if the rootElement exists outside of the tag', function() {
module(function($provide) {
$provide.factory('$rootElement', function($document) {
return jqLite($document[0].querySelector('html'));
diff --git a/test/ngAnimate/animateCssSpec.js b/test/ngAnimate/animateCssSpec.js
index be5eb6ced46e..b0e7cf58faef 100644
--- a/test/ngAnimate/animateCssSpec.js
+++ b/test/ngAnimate/animateCssSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ngAnimate $animateCss", function() {
+describe('ngAnimate $animateCss', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
@@ -59,7 +59,7 @@ describe("ngAnimate $animateCss", function() {
}
});
- it("should return false if neither transitions or keyframes are supported by the browser",
+ it('should return false if neither transitions or keyframes are supported by the browser',
inject(function($animateCss, $sniffer, $rootElement, $document) {
var animator;
@@ -78,7 +78,7 @@ describe("ngAnimate $animateCss", function() {
describe('when active', function() {
if (!browserSupportsCssAnimations()) return;
- it("should not attempt an animation if animations are globally disabled",
+ it('should not attempt an animation if animations are globally disabled',
inject(function($animateCss, $animate, $rootElement, $document) {
$animate.enabled(false);
@@ -95,7 +95,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeFalsy();
}));
- it("should silently quit the animation and not throw when an element has no parent during preparation",
+ it('should silently quit the animation and not throw when an element has no parent during preparation',
inject(function($animateCss, $rootScope, $document, $rootElement) {
var element = angular.element('
');
@@ -112,7 +112,7 @@ describe("ngAnimate $animateCss", function() {
expect(element).not.toHaveClass('fake-active');
}));
- it("should silently quit the animation and not throw when an element has no parent before starting",
+ it('should silently quit the animation and not throw when an element has no parent before starting',
inject(function($animateCss, $$rAF, $rootScope, $document, $rootElement) {
var element = angular.element('
');
@@ -132,8 +132,8 @@ describe("ngAnimate $animateCss", function() {
}).not.toThrow();
}));
- describe("rAF usage", function() {
- it("should buffer all requests into a single requestAnimationFrame call",
+ describe('rAF usage', function() {
+ it('should buffer all requests into a single requestAnimationFrame call',
inject(function($animateCss, $$rAF, $rootScope, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -165,7 +165,7 @@ describe("ngAnimate $animateCss", function() {
expect(count).toBe(3);
}));
- it("should cancel previous requests to rAF to avoid premature flushing", function() {
+ it('should cancel previous requests to rAF to avoid premature flushing', function() {
var count = 0;
module(function($provide) {
$provide.value('$$rAF', function() {
@@ -191,7 +191,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- describe("animator and runner", function() {
+ describe('animator and runner', function() {
var animationDuration = 5;
var element, animator;
beforeEach(inject(function($animateCss, $rootElement, $document) {
@@ -367,8 +367,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("CSS", function() {
- describe("detected styles", function() {
+ describe('CSS', function() {
+ describe('detected styles', function() {
var element, options;
function assertAnimationComplete(bool) {
@@ -387,7 +387,7 @@ describe("ngAnimate $animateCss", function() {
options = { event: 'enter', structural: true };
}));
- it("should always return an object even if no animation is detected",
+ it('should always return an object even if no animation is detected',
inject(function($animateCss) {
ss.addRule('.some-animation', 'background:red;');
@@ -401,7 +401,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBe(false);
}));
- it("should close the animation immediately, but still return an animator object if no animation is detected",
+ it('should close the animation immediately, but still return an animator object if no animation is detected',
inject(function($animateCss) {
ss.addRule('.another-fake-animation', 'background:blue;');
@@ -416,7 +416,7 @@ describe("ngAnimate $animateCss", function() {
expect(isFunction(animator.start)).toBeTruthy();
}));
- they("should close the animation, but still accept $prop callbacks if no animation is detected",
+ they('should close the animation, but still accept $prop callbacks if no animation is detected',
['done', 'then'], function(method) {
inject(function($animateCss, $animate, $rootScope) {
@@ -443,7 +443,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- they("should close the animation, but still accept recognize runner.$prop if no animation is detected",
+ they('should close the animation, but still accept recognize runner.$prop if no animation is detected',
['done(cancel)', 'catch'], function(method) {
inject(function($animateCss, $rootScope) {
@@ -478,7 +478,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- it("should use the highest transition duration value detected in the CSS class", inject(function($animateCss) {
+ it('should use the highest transition duration value detected in the CSS class', inject(function($animateCss) {
ss.addRule('.ng-enter', 'transition:1s linear all;' +
'transition-duration:10s, 15s, 20s;');
@@ -497,7 +497,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest transition delay value detected in the CSS class", inject(function($animateCss) {
+ it('should use the highest transition delay value detected in the CSS class', inject(function($animateCss) {
ss.addRule('.ng-enter', 'transition:1s linear all;' +
'transition-delay:10s, 15s, 20s;');
@@ -516,7 +516,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should only close when both the animation delay and duration have passed",
+ it('should only close when both the animation delay and duration have passed',
inject(function($animateCss) {
ss.addRule('.ng-enter', 'transition:10s 5s linear all;');
@@ -535,7 +535,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest keyframe duration value detected in the CSS class", inject(function($animateCss) {
+ it('should use the highest keyframe duration value detected in the CSS class', inject(function($animateCss) {
ss.addRule('.ng-enter', 'animation:animation 1s, animation 2s, animation 3s;' +
'-webkit-animation:animation 1s, animation 2s, animation 3s;');
@@ -554,7 +554,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest keyframe delay value detected in the CSS class", inject(function($animateCss) {
+ it('should use the highest keyframe delay value detected in the CSS class', inject(function($animateCss) {
ss.addRule('.ng-enter', 'animation:animation 1s 2s, animation 1s 10s, animation 1s 1000ms;' +
'-webkit-animation:animation 1s 2s, animation 1s 10s, animation 1s 1000ms;');
@@ -573,7 +573,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest keyframe duration value detected in the CSS class with respect to the animation-iteration-count property", inject(function($animateCss) {
+ it('should use the highest keyframe duration value detected in the CSS class with respect to the animation-iteration-count property', inject(function($animateCss) {
ss.addRule('.ng-enter',
'animation:animation 1s 2s 3, animation 1s 10s 2, animation 1s 1000ms infinite;' +
'-webkit-animation:animation 1s 2s 3, animation 1s 10s 2, animation 1s 1000ms infinite;');
@@ -593,7 +593,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest duration value when both transitions and keyframes are used", inject(function($animateCss) {
+ it('should use the highest duration value when both transitions and keyframes are used', inject(function($animateCss) {
ss.addRule('.ng-enter', 'transition:1s linear all;' +
'transition-duration:10s, 15s, 20s;' +
'animation:animation 1s, animation 2s, animation 3s 0s 7;' +
@@ -622,7 +622,7 @@ describe("ngAnimate $animateCss", function() {
assertAnimationComplete(true);
}));
- it("should use the highest delay value when both transitions and keyframes are used", inject(function($animateCss) {
+ it('should use the highest delay value when both transitions and keyframes are used', inject(function($animateCss) {
ss.addRule('.ng-enter', 'transition:1s linear all;' +
'transition-delay:10s, 15s, 20s;' +
'animation:animation 1s 2s, animation 1s 16s, animation 1s 19s;' +
@@ -651,8 +651,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("staggering", function() {
- it("should apply a stagger based when an active ng-EVENT-stagger class with a transition-delay is detected",
+ describe('staggering', function() {
+ it('should apply a stagger based when an active ng-EVENT-stagger class with a transition-delay is detected',
inject(function($animateCss, $document, $rootElement, $timeout) {
angular.element($document[0].body).append($rootElement);
@@ -693,7 +693,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should apply a stagger based when for all provided addClass/removeClass CSS classes",
+ it('should apply a stagger based when for all provided addClass/removeClass CSS classes',
inject(function($animateCss, $document, $rootElement, $timeout) {
angular.element($document[0].body).append($rootElement);
@@ -763,7 +763,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should block the transition animation between start and animate when staggered",
+ it('should block the transition animation between start and animate when staggered',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -794,7 +794,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should block (pause) the keyframe animation between start and animate when staggered",
+ it('should block (pause) the keyframe animation between start and animate when staggered',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -823,7 +823,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should not apply a stagger if the transition delay value is inherited from a earlier CSS class",
+ it('should not apply a stagger if the transition delay value is inherited from a earlier CSS class',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -842,7 +842,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should apply a stagger only if the transition duration value is zero when inherited from a earlier CSS class",
+ it('should apply a stagger only if the transition duration value is zero when inherited from a earlier CSS class',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -868,7 +868,7 @@ describe("ngAnimate $animateCss", function() {
}));
- it("should ignore animation staggers if only transition animations were detected",
+ it('should ignore animation staggers if only transition animations were detected',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -888,7 +888,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should ignore transition staggers if only keyframe animations were detected",
+ it('should ignore transition staggers if only keyframe animations were detected',
inject(function($animateCss, $document, $rootElement) {
angular.element($document[0].body).append($rootElement);
@@ -908,7 +908,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should start on the highest stagger value if both transition and keyframe staggers are used together",
+ it('should start on the highest stagger value if both transition and keyframe staggers are used together',
inject(function($animateCss, $document, $rootElement, $timeout, $browser) {
angular.element($document[0].body).append($rootElement);
@@ -946,7 +946,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should apply the closing timeout ontop of the stagger timeout",
+ it('should apply the closing timeout ontop of the stagger timeout',
inject(function($animateCss, $document, $rootElement, $timeout, $browser) {
angular.element($document[0].body).append($rootElement);
@@ -973,7 +973,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should apply the closing timeout ontop of the stagger timeout with an added delay",
+ it('should apply the closing timeout ontop of the stagger timeout with an added delay',
inject(function($animateCss, $document, $rootElement, $timeout, $browser) {
angular.element($document[0].body).append($rootElement);
@@ -1000,7 +1000,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should issue a stagger if a stagger value is provided in the options",
+ it('should issue a stagger if a stagger value is provided in the options',
inject(function($animateCss, $document, $rootElement, $timeout) {
angular.element($document[0].body).append($rootElement);
@@ -1039,7 +1039,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should only add/remove classes once the stagger timeout has passed",
+ it('should only add/remove classes once the stagger timeout has passed',
inject(function($animateCss, $document, $rootElement, $timeout) {
angular.element($document[0].body).append($rootElement);
@@ -1065,8 +1065,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("closing timeout", function() {
- it("should close off the animation after 150% of the animation time has passed",
+ describe('closing timeout', function() {
+ it('should close off the animation after 150% of the animation time has passed',
inject(function($animateCss, $document, $rootElement, $timeout) {
ss.addRule('.ng-enter', 'transition:10s linear all;');
@@ -1089,7 +1089,7 @@ describe("ngAnimate $animateCss", function() {
expect(element).not.toHaveClass('ng-enter-active');
}));
- it("should close off the animation after 150% of the animation time has passed and consider the detected delay value",
+ it('should close off the animation after 150% of the animation time has passed and consider the detected delay value',
inject(function($animateCss, $document, $rootElement, $timeout) {
ss.addRule('.ng-enter', 'transition:10s linear all; transition-delay:30s;');
@@ -1112,7 +1112,7 @@ describe("ngAnimate $animateCss", function() {
expect(element).not.toHaveClass('ng-enter-active');
}));
- it("should still resolve the animation once expired",
+ it('should still resolve the animation once expired',
inject(function($animateCss, $document, $rootElement, $timeout, $animate, $rootScope) {
ss.addRule('.ng-enter', 'transition:10s linear all;');
@@ -1137,7 +1137,7 @@ describe("ngAnimate $animateCss", function() {
expect(passed).toBe(true);
}));
- it("should not resolve/reject after passing if the animation completed successfully",
+ it('should not resolve/reject after passing if the animation completed successfully',
inject(function($animateCss, $document, $rootElement, $timeout, $rootScope, $animate) {
ss.addRule('.ng-enter', 'transition:10s linear all;');
@@ -1174,7 +1174,7 @@ describe("ngAnimate $animateCss", function() {
expect(failed).not.toBe(true);
}));
- it("should close all stacked animations after the last timeout runs on the same element",
+ it('should close all stacked animations after the last timeout runs on the same element',
inject(function($animateCss, $document, $rootElement, $timeout, $animate) {
var now = 0;
@@ -1232,7 +1232,7 @@ describe("ngAnimate $animateCss", function() {
}
}));
- it("should not throw an error any pending timeout requests resolve after the element has already been removed",
+ it('should not throw an error any pending timeout requests resolve after the element has already been removed',
inject(function($animateCss, $document, $rootElement, $timeout, $animate) {
var element = angular.element('
');
@@ -1250,7 +1250,7 @@ describe("ngAnimate $animateCss", function() {
}).not.toThrow();
}));
- it("should consider a positive options.delay value for the closing timeout",
+ it('should consider a positive options.delay value for the closing timeout',
inject(function($animateCss, $rootElement, $timeout, $document) {
var element = angular.element('
');
@@ -1283,7 +1283,7 @@ describe("ngAnimate $animateCss", function() {
expect(getPossiblyPrefixedStyleValue(element, 'transition-delay')).toBeOneOf('', '0s');
}));
- it("should ignore a boolean options.delay value for the closing timeout",
+ it('should ignore a boolean options.delay value for the closing timeout',
inject(function($animateCss, $rootElement, $timeout, $document) {
var element = angular.element('
');
@@ -1317,7 +1317,7 @@ describe("ngAnimate $animateCss", function() {
}));
- it("should cancel the timeout when the animation is ended normally",
+ it('should cancel the timeout when the animation is ended normally',
inject(function($animateCss, $document, $rootElement, $timeout) {
ss.addRule('.ng-enter', 'transition:10s linear all;');
@@ -1342,10 +1342,10 @@ describe("ngAnimate $animateCss", function() {
});
- describe("getComputedStyle", function() {
+ describe('getComputedStyle', function() {
var count;
var acceptableTimingsData = {
- transitionDuration: "10s"
+ transitionDuration: '10s'
};
beforeEach(module(function($provide) {
@@ -1366,7 +1366,7 @@ describe("ngAnimate $animateCss", function() {
};
}));
- it("should cache frequent calls to getComputedStyle before the next animation frame kicks in",
+ it('should cache frequent calls to getComputedStyle before the next animation frame kicks in',
inject(function($animateCss, $document, $rootElement) {
var i, elm, animator;
@@ -1401,7 +1401,7 @@ describe("ngAnimate $animateCss", function() {
expect(count.normal).toBe(3);
}));
- it("should cache frequent calls to getComputedStyle for stagger animations before the next animation frame kicks in",
+ it('should cache frequent calls to getComputedStyle for stagger animations before the next animation frame kicks in',
inject(function($animateCss, $document, $rootElement, $$rAF) {
var element = angular.element('
');
@@ -1494,7 +1494,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- they("should remove the $prop event listener when the animation is closed",
+ they('should remove the $prop event listener when the animation is closed',
[TRANSITIONEND_EVENT, ANIMATIONEND_EVENT], function(event) {
inject(function($animateCss) {
@@ -1518,7 +1518,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- they("should remove the $prop event listener when the closing timeout occurs",
+ they('should remove the $prop event listener when the closing timeout occurs',
[TRANSITIONEND_EVENT, ANIMATIONEND_EVENT], function(event) {
inject(function($animateCss, $timeout) {
@@ -1542,7 +1542,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- they("should not add or remove $prop event listeners when no animation styles are detected",
+ they('should not add or remove $prop event listeners when no animation styles are detected',
[TRANSITIONEND_EVENT, ANIMATIONEND_EVENT], function(event) {
inject(function($animateCss, $timeout) {
@@ -1614,7 +1614,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).not.toContain('transition');
}));
- it("should clear cache if no animation so follow-up animation on the same element will not be from cache",
+ it('should clear cache if no animation so follow-up animation on the same element will not be from cache',
inject(function($animateCss, $rootElement, $document, $$rAF) {
var element = angular.element('
');
var options = {
@@ -1651,7 +1651,7 @@ describe("ngAnimate $animateCss", function() {
expect(element).toHaveClass('super-active');
}));
- describe("structural animations", function() {
+ describe('structural animations', function() {
they('should decorate the element with the ng-$prop CSS class',
['enter', 'leave', 'move'], function(event) {
inject(function($animateCss, $rootElement, $document) {
@@ -1907,7 +1907,7 @@ describe("ngAnimate $animateCss", function() {
);
});
- describe("class-based animations", function() {
+ describe('class-based animations', function() {
they('should decorate the element with the class-$prop CSS class',
['add', 'remove'], function(event) {
inject(function($animateCss, $rootElement) {
@@ -2043,7 +2043,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- describe("options", function() {
+ describe('options', function() {
var element;
beforeEach(module(function() {
return function($rootElement, $document) {
@@ -2054,7 +2054,7 @@ describe("ngAnimate $animateCss", function() {
};
}));
- it("should not alter the provided options input in any way throughout the animation", inject(function($animateCss) {
+ it('should not alter the provided options input in any way throughout the animation', inject(function($animateCss) {
var initialOptions = {
from: { height: '50px' },
to: { width: '50px' },
@@ -2085,7 +2085,7 @@ describe("ngAnimate $animateCss", function() {
expect(copiedOptions).toEqual(initialOptions);
}));
- it("should not create a copy of the provided options if they have already been prepared earlier",
+ it('should not create a copy of the provided options if they have already been prepared earlier',
inject(function($animate, $animateCss) {
var options = {
@@ -2107,7 +2107,7 @@ describe("ngAnimate $animateCss", function() {
expect(options.from).toBeFalsy();
}));
- describe("[$$skipPreparationClasses]", function() {
+ describe('[$$skipPreparationClasses]', function() {
it('should not apply and remove the preparation classes to the element when true',
inject(function($animateCss) {
@@ -2146,8 +2146,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[duration]", function() {
- it("should be applied for a transition directly", inject(function($animateCss, $rootElement) {
+ describe('[duration]', function() {
+ it('should be applied for a transition directly', inject(function($animateCss, $rootElement) {
var element = angular.element('
');
$rootElement.append(element);
@@ -2167,7 +2167,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('linear');
}));
- it("should be applied to a CSS keyframe animation directly if keyframes are detected within the CSS class",
+ it('should be applied to a CSS keyframe animation directly if keyframes are detected within the CSS class',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:1.5s keyframe_animation;' +
@@ -2186,7 +2186,7 @@ describe("ngAnimate $animateCss", function() {
expect(getPossiblyPrefixedStyleValue(element, 'animation-duration')).toEqual('5s');
}));
- it("should remove all inline keyframe styling when an animation completes if a custom duration was applied",
+ it('should remove all inline keyframe styling when an animation completes if a custom duration was applied',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:1.5s keyframe_animation;' +
@@ -2208,7 +2208,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toBeFalsy();
}));
- it("should remove all inline keyframe delay styling when an animation completes if a custom duration was applied",
+ it('should remove all inline keyframe delay styling when an animation completes if a custom duration was applied',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:1.5s keyframe_animation;' +
@@ -2232,7 +2232,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toBeFalsy();
}));
- it("should not prepare the animation at all if a duration of zero is provided",
+ it('should not prepare the animation at all if a duration of zero is provided',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-transition:1s linear all;' +
@@ -2249,7 +2249,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeFalsy();
}));
- it("should apply a transition and keyframe duration directly if both transitions and keyframe classes are detected",
+ it('should apply a transition and keyframe duration directly if both transitions and keyframe classes are detected',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:3s keyframe_animation;' +
@@ -2274,8 +2274,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[delay]", function() {
- it("should be applied for a transition directly", inject(function($animateCss, $rootElement) {
+ describe('[delay]', function() {
+ it('should be applied for a transition directly', inject(function($animateCss, $rootElement) {
var element = angular.element('
');
$rootElement.append(element);
@@ -2295,7 +2295,7 @@ describe("ngAnimate $animateCss", function() {
expect(prop).toEqual('500s');
}));
- it("should return false for the animator if a delay is provided but not a duration",
+ it('should return false for the animator if a delay is provided but not a duration',
inject(function($animateCss, $rootElement) {
var element = angular.element('
');
@@ -2312,7 +2312,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeFalsy();
}));
- it("should override the delay value present in the CSS class",
+ it('should override the delay value present in the CSS class',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-transition:1s linear all;' +
@@ -2337,7 +2337,7 @@ describe("ngAnimate $animateCss", function() {
expect(prop).toEqual('500s');
}));
- it("should allow the delay value to zero if provided",
+ it('should allow the delay value to zero if provided',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-transition:1s linear all;' +
@@ -2362,7 +2362,7 @@ describe("ngAnimate $animateCss", function() {
expect(prop).toEqual('0s');
}));
- it("should be applied to a CSS keyframe animation if detected within the CSS class",
+ it('should be applied to a CSS keyframe animation if detected within the CSS class',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:1.5s keyframe_animation;' +
@@ -2382,7 +2382,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).not.toContain('transition-delay');
}));
- it("should apply a transition and keyframe delay if both transitions and keyframe classes are detected",
+ it('should apply a transition and keyframe delay if both transitions and keyframe classes are detected',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:3s keyframe_animation;' +
@@ -2406,7 +2406,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('transition-delay')).toEqual('10s');
}));
- it("should apply the keyframe and transition duration value before the CSS classes are applied", function() {
+ it('should apply the keyframe and transition duration value before the CSS classes are applied', function() {
var classSpy = jasmine.createSpy();
module(function($provide) {
$provide.value('$$jqLite', {
@@ -2453,7 +2453,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- it("should apply blocking before the animation starts, but then apply the detected delay when options.delay is true",
+ it('should apply blocking before the animation starts, but then apply the detected delay when options.delay is true',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', 'transition:2s linear all; transition-delay: 1s;');
@@ -2473,7 +2473,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style') || '').not.toContain('transition-delay');
}));
- it("should consider a negative value when delay:true is used with a keyframe animation",
+ it('should consider a negative value when delay:true is used with a keyframe animation',
inject(function($animateCss, $rootElement) {
ss.addPossiblyPrefixedRule('.ng-enter', 'animation: 2s keyframe_animation; ' +
@@ -2493,7 +2493,7 @@ describe("ngAnimate $animateCss", function() {
expect(getPossiblyPrefixedStyleValue(element, 'animation-delay')).toContain('-1s');
}));
- they("should consider a negative value when a negative option delay is provided for a $prop animation", {
+ they('should consider a negative value when a negative option delay is provided for a $prop animation', {
'transition': function() {
return {
prop: 'transition-delay',
@@ -2526,7 +2526,7 @@ describe("ngAnimate $animateCss", function() {
});
});
- they("should expect the $propend event to always return the full duration even when negative values are used", {
+ they('should expect the $propend event to always return the full duration even when negative values are used', {
'transition': function() {
return {
event: 'transitionend',
@@ -2564,8 +2564,8 @@ describe("ngAnimate $animateCss", function() {
});
});
- describe("[transitionStyle]", function() {
- it("should apply the transition directly onto the element and animate accordingly",
+ describe('[transitionStyle]', function() {
+ it('should apply the transition directly onto the element and animate accordingly',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2597,7 +2597,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toBeFalsy();
}));
- it("should give priority to the provided duration value, but only update the duration style itself",
+ it('should give priority to the provided duration value, but only update the duration style itself',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2618,7 +2618,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('ease-in');
}));
- it("should give priority to the provided delay value, but only update the delay style itself",
+ it('should give priority to the provided delay value, but only update the delay style itself',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2640,7 +2640,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('ease-in');
}));
- it("should execute the animation only if there is any provided CSS styling to go with the transition",
+ it('should execute the animation only if there is any provided CSS styling to go with the transition',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2662,8 +2662,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[keyframeStyle]", function() {
- it("should apply the keyframe animation directly onto the element and animate accordingly",
+ describe('[keyframeStyle]', function() {
+ it('should apply the keyframe animation directly onto the element and animate accordingly',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2694,7 +2694,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toBeFalsy();
}));
- it("should give priority to the provided duration value, but only update the duration style itself",
+ it('should give priority to the provided duration value, but only update the duration style itself',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2715,7 +2715,7 @@ describe("ngAnimate $animateCss", function() {
expect(detectedStyle).toContain('my_animation');
}));
- it("should give priority to the provided delay value, but only update the duration style itself",
+ it('should give priority to the provided delay value, but only update the duration style itself',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2736,7 +2736,7 @@ describe("ngAnimate $animateCss", function() {
expect(getPossiblyPrefixedStyleValue(element, 'animation-name')).toEqual('my_animation');
}));
- it("should be able to execute the animation if it is the only provided value",
+ it('should be able to execute the animation if it is the only provided value',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2754,8 +2754,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[from] and [to]", function() {
- it("should apply from styles to an element during the preparation phase",
+ describe('[from] and [to]', function() {
+ it('should apply from styles to an element during the preparation phase',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2770,7 +2770,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toMatch(/width:\s*50px/);
}));
- it("should apply to styles to an element during the animation phase",
+ it('should apply to styles to an element during the animation phase',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2789,7 +2789,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('width')).toBe('25px');
}));
- it("should apply the union of from and to styles to the element if no animation will be run",
+ it('should apply the union of from and to styles to the element if no animation will be run',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2808,7 +2808,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('height')).toBe('50px');
}));
- it("should retain to and from styles on an element after an animation completes",
+ it('should retain to and from styles on an element after an animation completes',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2832,7 +2832,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('height')).toBe('66px');
}));
- it("should always apply the from styles before the start function is called even if no transition is detected when started",
+ it('should always apply the from styles before the start function is called even if no transition is detected when started',
inject(function($animateCss, $rootElement) {
ss.addRule('.my-class', 'transition: 0s linear color');
@@ -2852,7 +2852,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('height')).toBe('500px');
}));
- it("should apply an inline transition if [to] styles and a duration are provided",
+ it('should apply an inline transition if [to] styles and a duration are provided',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2873,7 +2873,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('linear');
}));
- it("should remove all inline transition styling when an animation completes",
+ it('should remove all inline transition styling when an animation completes',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2898,7 +2898,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).not.toContain('transition');
}));
- it("should retain existing styles when an inline styled animation completes",
+ it('should retain existing styles when an inline styled animation completes',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2923,7 +2923,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.css('opacity')).toEqual('0.5');
}));
- it("should remove all inline transition delay styling when an animation completes",
+ it('should remove all inline transition delay styling when an animation completes',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', 'transition: 1s linear color');
@@ -2947,7 +2947,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style') || '').not.toContain('transition');
}));
- it("should not apply an inline transition if only [from] styles and a duration are provided",
+ it('should not apply an inline transition if only [from] styles and a duration are provided',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2959,7 +2959,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeFalsy();
}));
- it("should apply a transition if [from] styles are provided with a class that is added",
+ it('should apply a transition if [from] styles are provided with a class that is added',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2971,7 +2971,7 @@ describe("ngAnimate $animateCss", function() {
expect(isFunction(animator.start)).toBe(true);
}));
- it("should apply an inline transition if only [from] styles, but classes are added or removed and a duration is provided",
+ it('should apply an inline transition if only [from] styles, but classes are added or removed and a duration is provided',
inject(function($animateCss, $rootElement) {
var options = {
@@ -2984,7 +2984,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeTruthy();
}));
- it("should not apply an inline transition if no styles are provided",
+ it('should not apply an inline transition if no styles are provided',
inject(function($animateCss, $rootElement) {
var emptyObject = {};
@@ -2998,7 +2998,7 @@ describe("ngAnimate $animateCss", function() {
expect(animator.$$willAnimate).toBeFalsy();
}));
- it("should apply a transition duration if the existing transition duration's property value is not 'all'",
+ it('should apply a transition duration if the existing transition duration\'s property value is not \'all\'',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', 'transition: 1s linear color');
@@ -3021,7 +3021,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('linear');
}));
- it("should apply a transition duration and an animation duration if duration + styles options are provided for a matching keyframe animation",
+ it('should apply a transition duration and an animation duration if duration + styles options are provided for a matching keyframe animation',
inject(function($animateCss, $rootElement) {
ss.addRule('.ng-enter', '-webkit-animation:3.5s keyframe_animation;' +
@@ -3047,7 +3047,7 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[easing]", function() {
+ describe('[easing]', function() {
var element;
beforeEach(inject(function($document, $rootElement) {
@@ -3056,7 +3056,7 @@ describe("ngAnimate $animateCss", function() {
angular.element($document[0].body).append($rootElement);
}));
- it("should apply easing to a transition animation if it exists", inject(function($animateCss) {
+ it('should apply easing to a transition animation if it exists', inject(function($animateCss) {
ss.addRule('.red', 'transition:1s linear all;');
var easing = 'ease-out';
var animator = $animateCss(element, { addClass: 'red', easing: easing });
@@ -3067,7 +3067,7 @@ describe("ngAnimate $animateCss", function() {
expect(style).toContain('ease-out');
}));
- it("should not apply easing to transitions nor keyframes on an element animation if nothing is detected",
+ it('should not apply easing to transitions nor keyframes on an element animation if nothing is detected',
inject(function($animateCss) {
ss.addRule('.red', ';');
@@ -3079,7 +3079,7 @@ describe("ngAnimate $animateCss", function() {
expect(element.attr('style')).toBeFalsy();
}));
- it("should apply easing to both keyframes and transition animations if detected",
+ it('should apply easing to both keyframes and transition animations if detected',
inject(function($animateCss) {
ss.addRule('.red', 'transition: 1s linear all;');
@@ -3095,8 +3095,8 @@ describe("ngAnimate $animateCss", function() {
}));
});
- describe("[cleanupStyles]", function() {
- it("should cleanup [from] and [to] styles that have been applied for the animation when true",
+ describe('[cleanupStyles]', function() {
+ it('should cleanup [from] and [to] styles that have been applied for the animation when true',
inject(function($animateCss) {
var runner = $animateCss(element, {
diff --git a/test/ngAnimate/animateJsDriverSpec.js b/test/ngAnimate/animateJsDriverSpec.js
index 13438344f7d2..c079b25dbb8e 100644
--- a/test/ngAnimate/animateJsDriverSpec.js
+++ b/test/ngAnimate/animateJsDriverSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ngAnimate $$animateJsDriver", function() {
+describe('ngAnimate $$animateJsDriver', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
diff --git a/test/ngAnimate/animateJsSpec.js b/test/ngAnimate/animateJsSpec.js
index 6445c17b9c4a..09debed911c9 100644
--- a/test/ngAnimate/animateJsSpec.js
+++ b/test/ngAnimate/animateJsSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ngAnimate $$animateJs", function() {
+describe('ngAnimate $$animateJs', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
@@ -325,7 +325,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- describe("events", function() {
+ describe('events', function() {
var animations, runAnimation, element, log;
beforeEach(module(function($animateProvider) {
element = jqLite('
');
@@ -352,7 +352,7 @@ describe("ngAnimate $$animateJs", function() {
};
}));
- they("$prop should have the function signature of (element, done, options) for the after animation",
+ they('$prop should have the function signature of (element, done, options) for the after animation',
['enter', 'move', 'leave'], function(event) {
inject(function() {
var args;
@@ -370,7 +370,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should not execute a before function", enterMoveEvents, function(event) {
+ they('$prop should not execute a before function', enterMoveEvents, function(event) {
inject(function() {
var args;
var beforeMethod = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
@@ -384,7 +384,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should have the function signature of (element, className, done, options) for the before animation",
+ they('$prop should have the function signature of (element, className, done, options) for the before animation',
['addClass', 'removeClass'], function(event) {
inject(function() {
var beforeMethod = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
@@ -407,7 +407,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should have the function signature of (element, className, done, options) for the after animation",
+ they('$prop should have the function signature of (element, className, done, options) for the after animation',
['addClass', 'removeClass'], function(event) {
inject(function() {
var args;
@@ -429,7 +429,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("setClass should have the function signature of (element, addClass, removeClass, done, options) for the $prop animation", ['before', 'after'], function(event) {
+ they('setClass should have the function signature of (element, addClass, removeClass, done, options) for the $prop animation', ['before', 'after'], function(event) {
inject(function() {
var args;
var method = event === 'before' ? 'beforeSetClass' : 'setClass';
@@ -455,7 +455,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("animate should have the function signature of (element, from, to, done, options) for the $prop animation", ['before', 'after'], function(event) {
+ they('animate should have the function signature of (element, from, to, done, options) for the $prop animation', ['before', 'after'], function(event) {
inject(function() {
var args;
var method = event === 'before' ? 'beforeAnimate' : 'animate';
@@ -481,7 +481,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("custom events should have the function signature of (element, done, options) for the $prop animation", ['before', 'after'], function(event) {
+ they('custom events should have the function signature of (element, done, options) for the $prop animation', ['before', 'after'], function(event) {
inject(function() {
var args;
var method = event === 'before' ? 'beforeCustom' : 'custom';
@@ -504,7 +504,7 @@ describe("ngAnimate $$animateJs", function() {
var otherEvents = ['addClass', 'removeClass', 'setClass'];
var allEvents = ['leave'].concat(otherEvents).concat(enterMoveEvents);
- they("$prop should asynchronously render the before$prop animation", otherEvents, function(event) {
+ they('$prop should asynchronously render the before$prop animation', otherEvents, function(event) {
inject(function($animate) {
var beforeMethod = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
animations[beforeMethod] = function(element, a, b, c) {
@@ -521,7 +521,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should asynchronously render the $prop animation", allEvents, function(event) {
+ they('$prop should asynchronously render the $prop animation', allEvents, function(event) {
inject(function($animate) {
animations[event] = function(element, a, b, c) {
log.push('after ' + event);
@@ -545,7 +545,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should asynchronously render the $prop animation when a start/end animator object is returned",
+ they('$prop should asynchronously render the $prop animation when a start/end animator object is returned',
allEvents, function(event) {
inject(function($animate, $$AnimateRunner) {
@@ -578,7 +578,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should asynchronously render the $prop animation when an instance of $$AnimateRunner is returned",
+ they('$prop should asynchronously render the $prop animation when an instance of $$AnimateRunner is returned',
allEvents, function(event) {
inject(function($animate, $$AnimateRunner) {
@@ -607,7 +607,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should asynchronously reject the before animation if the callback function is called with false", otherEvents, function(event) {
+ they('$prop should asynchronously reject the before animation if the callback function is called with false', otherEvents, function(event) {
inject(function($animate, $rootScope) {
var beforeMethod = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
animations[beforeMethod] = function(element, a, b, c) {
@@ -632,7 +632,7 @@ describe("ngAnimate $$animateJs", function() {
});
});
- they("$prop should asynchronously reject the after animation if the callback function is called with false", allEvents, function(event) {
+ they('$prop should asynchronously reject the after animation if the callback function is called with false', allEvents, function(event) {
inject(function($animate, $rootScope) {
animations[event] = function(element, a, b, c) {
log.push('after ' + event);
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js
index 86e61c5adf85..76ddc34ddabd 100644
--- a/test/ngAnimate/animateSpec.js
+++ b/test/ngAnimate/animateSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("animations", function() {
+describe('animations', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
@@ -137,7 +137,7 @@ describe("animations", function() {
};
}));
- it("should not alter the provided options input in any way throughout the animation", inject(function($animate, $rootScope) {
+ it('should not alter the provided options input in any way throughout the animation', inject(function($animate, $rootScope) {
var initialOptions = {
from: { height: '50px' },
to: { width: '50px' },
@@ -156,7 +156,7 @@ describe("animations", function() {
expect(copiedOptions).toEqual(initialOptions);
}));
- it("should skip animations entirely if the document is hidden", function() {
+ it('should skip animations entirely if the document is hidden', function() {
var hidden = true;
module(function($provide) {
@@ -296,7 +296,7 @@ describe("animations", function() {
});
describe('enabled()', function() {
- it("should work for all animations", inject(function($animate) {
+ it('should work for all animations', inject(function($animate) {
expect($animate.enabled()).toBe(true);
@@ -682,7 +682,7 @@ describe("animations", function() {
{ '{}': {},
'null': null,
'false': false,
- '""': "",
+ '""': '',
'[]': [] }, function(toStyle) {
inject(function($animate, $rootScope) {
@@ -795,7 +795,7 @@ describe("animations", function() {
});
});
- it("should NOT clobber all data on an element when animation is finished",
+ it('should NOT clobber all data on an element when animation is finished',
inject(function($animate, $rootScope) {
element.data('foo', 'bar');
@@ -870,7 +870,7 @@ describe("animations", function() {
expect(capturedAnimation).toBeFalsy();
}));
- it("should disable all child animations for atleast one turn when a structural animation is issued",
+ it('should disable all child animations for atleast one turn when a structural animation is issued',
inject(function($animate, $rootScope, $compile, $document, $rootElement, $$AnimateRunner) {
element = $compile(
diff --git a/test/ngAnimate/animationHelperFunctionsSpec.js b/test/ngAnimate/animationHelperFunctionsSpec.js
index ba77869f11e7..c1c0e3f176e8 100644
--- a/test/ngAnimate/animationHelperFunctionsSpec.js
+++ b/test/ngAnimate/animationHelperFunctionsSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("animation option helper functions", function() {
+describe('animation option helper functions', function() {
beforeEach(module('ngAnimate'));
diff --git a/test/ngAnimate/animationSpec.js b/test/ngAnimate/animationSpec.js
index f036908b0998..cb3f88fedbd6 100644
--- a/test/ngAnimate/animationSpec.js
+++ b/test/ngAnimate/animationSpec.js
@@ -14,7 +14,7 @@ describe('$$animation', function() {
$$animationProvider.drivers.length = 0;
}));
- it("should not run an animation if there are no drivers",
+ it('should not run an animation if there are no drivers',
inject(function($$animation, $animate, $rootScope) {
element = jqLite('
');
@@ -27,7 +27,7 @@ describe('$$animation', function() {
expect(done).toBe(true);
}));
- it("should not run an animation if no drivers return an animation step function", function() {
+ it('should not run an animation if no drivers return an animation step function', function() {
module(function($$animationProvider, $provide) {
$$animationProvider.drivers.push('matiasDriver');
$provide.value('matiasDriver', function() {
@@ -47,8 +47,8 @@ describe('$$animation', function() {
});
});
- describe("drivers", function() {
- it("should use the first driver that returns a step function", function() {
+ describe('drivers', function() {
+ it('should use the first driver that returns a step function', function() {
var count = 0;
var activeDriver;
module(function($$animationProvider, $provide) {
@@ -111,7 +111,7 @@ describe('$$animation', function() {
});
}));
- it("should obtain the element, event, the provided options and the domOperation",
+ it('should obtain the element, event, the provided options and the domOperation',
inject(function($$animation, $rootScope, $rootElement) {
$rootElement.append(element);
@@ -135,7 +135,7 @@ describe('$$animation', function() {
expect(domOperationCalled).toBe(true);
}));
- it("should obtain the classes string which is a combination of className, addClass and removeClass",
+ it('should obtain the classes string which is a combination of className, addClass and removeClass',
inject(function($$animation, $rootScope, $rootElement) {
element.addClass('blue red');
@@ -154,7 +154,7 @@ describe('$$animation', function() {
}));
});
- it("should traverse the drivers in reverse order", function() {
+ it('should traverse the drivers in reverse order', function() {
var log = [];
module(function($$animationProvider, $provide) {
$$animationProvider.drivers.push('first');
@@ -180,7 +180,7 @@ describe('$$animation', function() {
});
});
- they("should $prop the animation call if the driver $proped the returned promise",
+ they('should $prop the animation call if the driver $proped the returned promise',
['resolve', 'reject'], function(event) {
module(function($$animationProvider, $provide) {
@@ -222,7 +222,7 @@ describe('$$animation', function() {
});
});
- they("should $prop the driver animation when runner.$prop() is called",
+ they('should $prop the driver animation when runner.$prop() is called',
['cancel', 'end'], function(method) {
var log = [];
@@ -293,7 +293,7 @@ describe('$$animation', function() {
}
}));
- describe("singular", function() {
+ describe('singular', function() {
beforeEach(module(function($provide) {
element = jqLite('
');
return function($rootElement) {
@@ -538,7 +538,7 @@ describe('$$animation', function() {
});
});
- describe("grouped", function() {
+ describe('grouped', function() {
var fromElement;
var toElement;
var fromAnchors;
@@ -569,7 +569,7 @@ describe('$$animation', function() {
};
}));
- it("should group animations together when they have shared anchors and a shared CSS class",
+ it('should group animations together when they have shared anchors and a shared CSS class',
inject(function($$animation, $rootScope) {
fromElement.addClass('shared-class');
@@ -600,7 +600,7 @@ describe('$$animation', function() {
assertCompareNodes(toElm, anchors['in']);
}));
- it("should group animations together and properly match up multiple anchors based on their references",
+ it('should group animations together and properly match up multiple anchors based on their references',
inject(function($$animation, $rootScope) {
var attr = 'ng-animate-ref';
@@ -632,7 +632,7 @@ describe('$$animation', function() {
assertCompareNodes(toAnchors[1], anchors[2]['in']);
}));
- it("should group animations together on the from and to elements if their both contain matching anchors",
+ it('should group animations together on the from and to elements if their both contain matching anchors',
inject(function($$animation, $rootScope) {
fromElement.addClass('shared-class');
@@ -650,7 +650,7 @@ describe('$$animation', function() {
assertCompareNodes(toElement, anchors['in']);
}));
- it("should not group animations into an anchored animation if enter/leave events are NOT used",
+ it('should not group animations into an anchored animation if enter/leave events are NOT used',
inject(function($$animation, $rootScope, $$rAF) {
fromElement.addClass('shared-class');
@@ -670,7 +670,7 @@ describe('$$animation', function() {
expect(captureLog.length).toBe(2);
}));
- it("should not group animations together if a matching pair of anchors is not detected",
+ it('should not group animations together if a matching pair of anchors is not detected',
inject(function($$animation, $rootScope) {
fromElement.addClass('shared-class');
@@ -686,7 +686,7 @@ describe('$$animation', function() {
expect(captureLog.length).toBe(2);
}));
- it("should not group animations together if a matching CSS class is not detected",
+ it('should not group animations together if a matching CSS class is not detected',
inject(function($$animation, $rootScope) {
fromElement.addClass('even-class');
@@ -702,7 +702,7 @@ describe('$$animation', function() {
expect(captureLog.length).toBe(2);
}));
- it("should expose the shared CSS class in the options provided to the driver",
+ it('should expose the shared CSS class in the options provided to the driver',
inject(function($$animation, $rootScope) {
fromElement.addClass('fresh-class');
@@ -718,7 +718,7 @@ describe('$$animation', function() {
expect(capturedAnimation.classes).toBe('fresh-class');
}));
- it("should update the runner methods to the grouped runner methods handled by the driver",
+ it('should update the runner methods to the grouped runner methods handled by the driver',
inject(function($$animation, $rootScope) {
fromElement.addClass('group-1');
@@ -738,7 +738,7 @@ describe('$$animation', function() {
expect(runner1.cancel).toBe(runner2.cancel);
}));
- they("should end the animation if the $prop element is prematurely removed from the DOM during the animation", ['from', 'to'], function(event) {
+ they('should end the animation if the $prop element is prematurely removed from the DOM during the animation', ['from', 'to'], function(event) {
inject(function($$animation, $rootScope) {
fromElement.addClass('group-1');
$$animation(fromElement, 'leave');
@@ -757,7 +757,7 @@ describe('$$animation', function() {
});
});
- it("should not end the animation when the `from` animation calls its own leave dom operation",
+ it('should not end the animation when the `from` animation calls its own leave dom operation',
inject(function($$animation, $rootScope) {
fromElement.addClass('group-1');
@@ -787,7 +787,7 @@ describe('$$animation', function() {
expect(runnerLog).toEqual([]);
}));
- it("should not end the animation if any of the anchor elements are removed from the DOM during the animation",
+ it('should not end the animation if any of the anchor elements are removed from the DOM during the animation',
inject(function($$animation, $rootScope) {
fromElement.addClass('group-1');
diff --git a/test/ngAnimate/integrationSpec.js b/test/ngAnimate/integrationSpec.js
index a84c3eb88a2a..c17b737c6e7f 100644
--- a/test/ngAnimate/integrationSpec.js
+++ b/test/ngAnimate/integrationSpec.js
@@ -99,7 +99,7 @@ describe('ngAnimate integration tests', function() {
describe('CSS animations', function() {
if (!browserSupportsCssAnimations()) return;
- it("should only create a single copy of the provided animation options",
+ it('should only create a single copy of the provided animation options',
inject(function($rootScope, $rootElement, $animate) {
ss.addRule('.animate-me', 'transition:2s linear all;');
@@ -481,7 +481,7 @@ describe('ngAnimate integration tests', function() {
}));
- it("should remove a class when the same class is currently being added by a joined class-based animation",
+ it('should remove a class when the same class is currently being added by a joined class-based animation',
inject(function($animate, $animateCss, $rootScope, $document, $rootElement, $$rAF) {
ss.addRule('.hide', 'opacity: 0');
@@ -756,7 +756,7 @@ describe('ngAnimate integration tests', function() {
});
});
- it("should not alter the provided options values in anyway throughout the animation", function() {
+ it('should not alter the provided options values in anyway throughout the animation', function() {
var animationSpy = jasmine.createSpy();
module(function($animateProvider) {
$animateProvider.register('.this-animation', function() {
diff --git a/test/ngAnimate/ngAnimateSwapSpec.js b/test/ngAnimate/ngAnimateSwapSpec.js
index 4795ce858441..e611f72d57db 100644
--- a/test/ngAnimate/ngAnimateSwapSpec.js
+++ b/test/ngAnimate/ngAnimateSwapSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ngAnimateSwap", function() {
+describe('ngAnimateSwap', function() {
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimateMock'));
@@ -133,7 +133,7 @@ describe("ngAnimateSwap", function() {
}));
- describe("animations", function() {
+ describe('animations', function() {
it('should trigger a leave animation followed by an enter animation upon swap',
inject(function() {
diff --git a/test/ngAnimate/rafSchedulerSpec.js b/test/ngAnimate/rafSchedulerSpec.js
index 16c7906534a4..b0d37a9cd525 100644
--- a/test/ngAnimate/rafSchedulerSpec.js
+++ b/test/ngAnimate/rafSchedulerSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("$$rAFScheduler", function() {
+describe('$$rAFScheduler', function() {
beforeEach(module('ngAnimate'));
diff --git a/test/ngAria/ariaSpec.js b/test/ngAria/ariaSpec.js
index 258078d538d9..9f7edaa2e9c0 100644
--- a/test/ngAria/ariaSpec.js
+++ b/test/ngAria/ariaSpec.js
@@ -173,11 +173,11 @@ describe('$aria', function() {
var element = $compile(' ' +
' ')(scope);
- scope.$apply("val='one'");
+ scope.$apply('val=\'one\'');
expect(element.eq(0).attr('aria-checked')).toBeUndefined();
expect(element.eq(1).attr('aria-checked')).toBeUndefined();
- scope.$apply("val='two'");
+ scope.$apply('val=\'two\'');
expect(element.eq(0).attr('aria-checked')).toBeUndefined();
expect(element.eq(1).attr('aria-checked')).toBeUndefined();
});
@@ -186,11 +186,11 @@ describe('$aria', function() {
var element = $compile('
' +
'
')(scope);
- scope.$apply("val='one'");
+ scope.$apply('val=\'one\'');
expect(element.eq(0).attr('aria-checked')).toBe('true');
expect(element.eq(1).attr('aria-checked')).toBe('false');
- scope.$apply("val='two'");
+ scope.$apply('val=\'two\'');
expect(element.eq(0).attr('aria-checked')).toBe('false');
expect(element.eq(1).attr('aria-checked')).toBe('true');
});
@@ -199,11 +199,11 @@ describe('$aria', function() {
var element = $compile('
' +
'
')(scope);
- scope.$apply("val=0");
+ scope.$apply('val=0');
expect(element.eq(0).attr('aria-checked')).toBe('true');
expect(element.eq(1).attr('aria-checked')).toBe('false');
- scope.$apply("val=1");
+ scope.$apply('val=1');
expect(element.eq(0).attr('aria-checked')).toBe('false');
expect(element.eq(1).attr('aria-checked')).toBe('true');
});
@@ -230,7 +230,7 @@ describe('$aria', function() {
compileElement('
');
expect(element.attr('aria-checked')).toBe('true');
- scope.$apply("val = 'two'");
+ scope.$apply('val = \'two\'');
expect(element.attr('aria-checked')).toBe('false');
});
@@ -246,12 +246,12 @@ describe('$aria', function() {
it('should not attach itself if an aria-checked value is already present', function() {
var element = [
- $compile("
")(scope),
- $compile("
")(scope),
- $compile("
")(scope),
- $compile("
")(scope)
+ $compile('
')(scope),
+ $compile('
')(scope),
+ $compile('
')(scope),
+ $compile('
')(scope)
];
- scope.$apply("val1=true;val2='one';val3='1'");
+ scope.$apply('val1=true;val2=\'one\';val3=\'1\'');
expectAriaAttrOnEachElement(element, 'aria-checked', 'userSetValue');
});
});
@@ -320,16 +320,16 @@ describe('$aria', function() {
beforeEach(injectScopeAndCompiler);
it('should not attach aria-checked', function() {
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-checked')).toBeUndefined();
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-checked')).toBeUndefined();
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-checked')).toBeUndefined();
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-checked')).toBeUndefined();
});
});
@@ -399,25 +399,25 @@ describe('$aria', function() {
it('should attach aria-invalid to input', function() {
compileElement(' ');
- scope.$apply("txtInput='LTten'");
+ scope.$apply('txtInput=\'LTten\'');
expect(element.attr('aria-invalid')).toBe('true');
- scope.$apply("txtInput='morethantencharacters'");
+ scope.$apply('txtInput=\'morethantencharacters\'');
expect(element.attr('aria-invalid')).toBe('false');
});
it('should attach aria-invalid to custom controls', function() {
compileElement('
');
- scope.$apply("txtInput='LTten'");
+ scope.$apply('txtInput=\'LTten\'');
expect(element.attr('aria-invalid')).toBe('true');
- scope.$apply("txtInput='morethantencharacters'");
+ scope.$apply('txtInput=\'morethantencharacters\'');
expect(element.attr('aria-invalid')).toBe('false');
});
it('should not attach itself if aria-invalid is already present', function() {
compileElement(' ');
- scope.$apply("txtInput='LTten'");
+ scope.$apply('txtInput=\'LTten\'');
expect(element.attr('aria-invalid')).toBe('userSetValue');
});
});
@@ -429,7 +429,7 @@ describe('$aria', function() {
beforeEach(injectScopeAndCompiler);
it('should not attach aria-invalid if the option is disabled', function() {
- scope.$apply("txtInput='LTten'");
+ scope.$apply('txtInput=\'LTten\'');
compileElement(' ');
expect(element.attr('aria-invalid')).toBeUndefined();
});
@@ -487,10 +487,10 @@ describe('$aria', function() {
beforeEach(injectScopeAndCompiler);
it('should not add the aria-readonly attribute', function() {
- compileElement(" ");
+ compileElement(' ');
expect(element.attr('aria-readonly')).toBeUndefined();
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-readonly')).toBeUndefined();
});
});
@@ -509,7 +509,7 @@ describe('$aria', function() {
});
it('should set aria-required to false when ng-required is false', function() {
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-required')).toBe('false');
});
@@ -519,7 +519,7 @@ describe('$aria', function() {
});
it('should not attach itself if aria-required is already present', function() {
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-required')).toBe('userSetValue');
});
});
@@ -531,10 +531,10 @@ describe('$aria', function() {
beforeEach(injectScopeAndCompiler);
it('should not add the aria-required attribute', function() {
- compileElement(" ");
+ compileElement(' ');
expect(element.attr('aria-required')).toBeUndefined();
- compileElement("
");
+ compileElement('
');
expect(element.attr('aria-required')).toBeUndefined();
});
});
@@ -550,12 +550,12 @@ describe('$aria', function() {
];
scope.$apply('val = 50');
- expectAriaAttrOnEachElement(element, 'aria-valuenow', "50");
- expectAriaAttrOnEachElement(element, 'aria-valuemin', "0");
- expectAriaAttrOnEachElement(element, 'aria-valuemax', "100");
+ expectAriaAttrOnEachElement(element, 'aria-valuenow', '50');
+ expectAriaAttrOnEachElement(element, 'aria-valuemin', '0');
+ expectAriaAttrOnEachElement(element, 'aria-valuemax', '100');
scope.$apply('val = 90');
- expectAriaAttrOnEachElement(element, 'aria-valuenow', "90");
+ expectAriaAttrOnEachElement(element, 'aria-valuenow', '90');
});
it('should not attach if aria-value* is already present', function() {
@@ -609,7 +609,7 @@ describe('$aria', function() {
var element = [
$compile('')(scope)
];
- expectAriaAttrOnEachElement(element, 'aria-live', "assertive");
+ expectAriaAttrOnEachElement(element, 'aria-live', 'assertive');
});
});
@@ -638,14 +638,14 @@ describe('$aria', function() {
beforeEach(injectScopeAndCompiler);
they('should not attach to native control $prop', {
- 'button': "
",
- 'a': "
",
- 'input[text]': " ",
- 'input[radio]': " ",
- 'input[checkbox]': " ",
- 'textarea': "",
- 'select': " ",
- 'details': " "
+ 'button': ' ',
+ 'a': ' ',
+ 'input[text]': ' ',
+ 'input[radio]': ' ',
+ 'input[checkbox]': ' ',
+ 'textarea': '',
+ 'select': ' ',
+ 'details': ' '
}, function(html) {
compileElement(html);
expect(element.attr('tabindex')).toBeUndefined();
diff --git a/test/ngCookies/cookieWriterSpec.js b/test/ngCookies/cookieWriterSpec.js
index 4a1419c4f8cf..d43fa8b37f6b 100644
--- a/test/ngCookies/cookieWriterSpec.js
+++ b/test/ngCookies/cookieWriterSpec.js
@@ -4,16 +4,16 @@ describe('$$cookieWriter', function() {
var $$cookieWriter, document;
function deleteAllCookies() {
- var cookies = document.cookie.split(";");
+ var cookies = document.cookie.split(';');
var path = window.location.pathname;
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
- var eqPos = cookie.indexOf("=");
+ var eqPos = cookie.indexOf('=');
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
var parts = path.split('/');
while (parts.length) {
- document.cookie = name + "=;path=" + (parts.join('/') || '/') + ";expires=Thu, 01 Jan 1970 00:00:00 GMT";
+ document.cookie = name + '=;path=' + (parts.join('/') || '/') + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';
parts.pop();
}
}
@@ -64,7 +64,7 @@ describe('$$cookieWriter', function() {
it('should overwrite an existing unsynced cookie', function() {
- document.cookie = "cookie=new;path=/";
+ document.cookie = 'cookie=new;path=/';
var oldVal = $$cookieWriter('cookie', 'newer');
@@ -76,7 +76,7 @@ describe('$$cookieWriter', function() {
$$cookieWriter('cookie1=', 'val;ue');
$$cookieWriter('cookie2=bar;baz', 'val=ue');
- var rawCookies = document.cookie.split("; "); //order is not guaranteed, so we need to parse
+ var rawCookies = document.cookie.split('; '); //order is not guaranteed, so we need to parse
expect(rawCookies.length).toEqual(2);
expect(rawCookies).toContain('cookie1%3D=val%3Bue');
expect(rawCookies).toContain('cookie2%3Dbar%3Bbaz=val%3Due');
@@ -97,8 +97,8 @@ describe('$$cookieWriter', function() {
$$cookieWriter('x', longVal + 'xxxx'); //total size 4097-4099, a warning should be logged
expect($log.warn.logs).toEqual(
- [["Cookie 'x' possibly not set or overflowed because it was too large (4097 > 4096 " +
- "bytes)!"]]);
+ [['Cookie \'x\' possibly not set or overflowed because it was too large (4097 > 4096 ' +
+ 'bytes)!']]);
//force browser to dropped a cookie and make sure that the cache is not out of sync
$$cookieWriter('x', 'shortVal');
@@ -107,8 +107,8 @@ describe('$$cookieWriter', function() {
$$cookieWriter('x', longVal + longVal + longVal); //should be too long for all browsers
if (document.cookie !== cookieStr) {
- this.fail(new Error("browser didn't drop long cookie when it was expected. make the " +
- "cookie in this test longer"));
+ this.fail(new Error('browser didn\'t drop long cookie when it was expected. make the ' +
+ 'cookie in this test longer'));
}
expect(document.cookie).toEqual('x=shortVal');
diff --git a/test/ngCookies/cookiesSpec.js b/test/ngCookies/cookiesSpec.js
index 1b36749901d3..38c030443c3f 100644
--- a/test/ngCookies/cookiesSpec.js
+++ b/test/ngCookies/cookiesSpec.js
@@ -29,7 +29,7 @@ describe('$cookies', function() {
it('should delete objects from the store when remove is called', inject(function($cookies) {
- $cookies.putObject('gonner', { "I'll":"Be Back"});
+ $cookies.putObject('gonner', { 'I\'ll':'Be Back'});
expect($cookies.get('gonner')).toEqual('{"I\'ll":"Be Back"}');
$cookies.remove('gonner');
expect($cookies.get('gonner')).toEqual(undefined);
@@ -37,11 +37,11 @@ describe('$cookies', function() {
it('should handle empty string value cookies', inject(function($cookies) {
- $cookies.putObject("emptyCookie",'');
+ $cookies.putObject('emptyCookie','');
expect($cookies.get('emptyCookie')).toEqual('""');
- expect($cookies.getObject("emptyCookie")).toEqual('');
+ expect($cookies.getObject('emptyCookie')).toEqual('');
mockedCookies['blankCookie'] = '';
- expect($cookies.getObject("blankCookie")).toEqual('');
+ expect($cookies.getObject('blankCookie')).toEqual('');
}));
diff --git a/test/ngMessageFormat/messageFormatSpec.js b/test/ngMessageFormat/messageFormatSpec.js
index 43a6ae477293..4e2405fe4423 100644
--- a/test/ngMessageFormat/messageFormatSpec.js
+++ b/test/ngMessageFormat/messageFormatSpec.js
@@ -24,10 +24,10 @@ describe('$$ngMessageFormat', function() {
this.gender = gender;
}
- var alice = new Person("Alice", "female"),
- bob = new Person("Bob", "male"),
- charlie = new Person("Charlie", "male"),
- harry = new Person("Harry Potter", "male");
+ var alice = new Person('Alice', 'female'),
+ bob = new Person('Bob', 'male'),
+ charlie = new Person('Charlie', 'male'),
+ harry = new Person('Harry Potter', 'male');
function initScope($scope) {
$scope.recipients = [alice, bob, charlie];
@@ -55,40 +55,40 @@ describe('$$ngMessageFormat', function() {
}
it('should suppress falsy objects', function() {
- assertMustache("{{undefined}}", "");
- assertMustache("{{null}}", "");
- assertMustache("{{a.b}}", "");
+ assertMustache('{{undefined}}', '');
+ assertMustache('{{null}}', '');
+ assertMustache('{{a.b}}', '');
});
it('should jsonify objects', function() {
- assertMustache("{{ {} }}", "{}");
- assertMustache("{{ true }}", "true");
- assertMustache("{{ false }}", "false");
- assertMustache("{{ 1 }}", "1");
- assertMustache("{{ '1' }}", "1");
- assertMustache("{{ sender }}", '{"name":"Harry Potter","gender":"male"}');
+ assertMustache('{{ {} }}', '{}');
+ assertMustache('{{ true }}', 'true');
+ assertMustache('{{ false }}', 'false');
+ assertMustache('{{ 1 }}', '1');
+ assertMustache('{{ \'1\' }}', '1');
+ assertMustache('{{ sender }}', '{"name":"Harry Potter","gender":"male"}');
});
it('should return function that can be called with no context', inject(function($interpolate) {
- expect($interpolate("{{sender.name}}")()).toEqual("");
+ expect($interpolate('{{sender.name}}')()).toEqual('');
}));
describe('watchable', function() {
it('ckck', function() {
var calls = [];
- $rootScope.$watch($interpolate("{{::name}}"), function(val) {
+ $rootScope.$watch($interpolate('{{::name}}'), function(val) {
calls.push(val);
});
$rootScope.$apply();
expect(calls.length).toBe(1);
- $rootScope.name = "foo";
+ $rootScope.name = 'foo';
$rootScope.$apply();
expect(calls.length).toBe(2);
expect(calls[1]).toBe('foo');
- $rootScope.name = "bar";
+ $rootScope.name = 'bar';
$rootScope.$apply();
expect(calls.length).toBe(2);
});
@@ -117,96 +117,96 @@ describe('$$ngMessageFormat', function() {
describe('plural', function() {
it('no interpolation', function() {
- var text = "" +
- "{{recipients.length, plural,\n" +
- " =0 {You gave no gifts}\n" +
- " =1 {You gave one person a gift}\n" +
+ var text = '' +
+ '{{recipients.length, plural,\n' +
+ ' =0 {You gave no gifts}\n' +
+ ' =1 {You gave one person a gift}\n' +
// "=1" should override "one" for exact value.
- " one {YOU SHOULD NEVER SEE THIS MESSAGE}\n" +
- " other {You gave some people gifts}\n" +
- "}}";
+ ' one {YOU SHOULD NEVER SEE THIS MESSAGE}\n' +
+ ' other {You gave some people gifts}\n' +
+ '}}';
var parsedFn = $interpolate(text, /*mustHaveExpression=*/true);
expect(parsedFn.expressions.length).toBe(1);
- expect(parsedFn.expressions[0]).toEqual("recipients.length");
+ expect(parsedFn.expressions[0]).toEqual('recipients.length');
$rootScope.recipients.length = 2;
- expect(parsedFn($rootScope)).toEqual("You gave some people gifts");
+ expect(parsedFn($rootScope)).toEqual('You gave some people gifts');
$rootScope.recipients.length = 1;
- expect(parsedFn($rootScope)).toEqual("You gave one person a gift");
+ expect(parsedFn($rootScope)).toEqual('You gave one person a gift');
$rootScope.recipients.length = 0;
- expect(parsedFn($rootScope)).toEqual("You gave no gifts");
+ expect(parsedFn($rootScope)).toEqual('You gave no gifts');
});
it('with interpolation', function() {
- var text = "" +
- "{{recipients.length, plural,\n" +
- " =0 {{{sender.name}} gave no gifts}\n" +
- " =1 {{{sender.name}} gave one gift to {{recipients[0].name}}}\n" +
+ var text = '' +
+ '{{recipients.length, plural,\n' +
+ ' =0 {{{sender.name}} gave no gifts}\n' +
+ ' =1 {{{sender.name}} gave one gift to {{recipients[0].name}}}\n' +
// "=1" should override "one" for exact value.
- " one {YOU SHOULD NEVER SEE THIS MESSAGE}\n" +
- " other {{{sender.name}} gave them a gift}\n" +
- "}}";
+ ' one {YOU SHOULD NEVER SEE THIS MESSAGE}\n' +
+ ' other {{{sender.name}} gave them a gift}\n' +
+ '}}';
var parsedFn = $interpolate(text, /*mustHaveExpression=*/true);
expect(parsedFn.expressions.length).toBe(1);
- expect(parsedFn.expressions[0]).toEqual("recipients.length");
+ expect(parsedFn.expressions[0]).toEqual('recipients.length');
$rootScope.recipients.length = 2;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave them a gift");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave them a gift');
$rootScope.recipients.length = 1;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave one gift to Alice");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave one gift to Alice');
$rootScope.recipients.length = 0;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave no gifts");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave no gifts');
});
it('with offset, interpolation, "#" symbol with and without escaping', function() {
- var text = "" +
- "{{recipients.length, plural, offset:1\n" +
+ var text = '' +
+ '{{recipients.length, plural, offset:1\n' +
// NOTE: It's nonsensical to use "#" for "=0" with a positive offset.
- " =0 {{{sender.name}} gave no gifts (\\#=#)}\n" +
- " =1 {{{sender.name}} gave one gift to {{recipients[0].name}} (\\#=#)}\n" +
- " one {{{sender.name}} gave {{recipients[0].name}} and one other person a gift (\\#=#)}\n" +
- " other {{{sender.name}} gave {{recipients[0].name}} and # other people a gift (\\#=#)}\n" +
- "}}";
+ ' =0 {{{sender.name}} gave no gifts (\\#=#)}\n' +
+ ' =1 {{{sender.name}} gave one gift to {{recipients[0].name}} (\\#=#)}\n' +
+ ' one {{{sender.name}} gave {{recipients[0].name}} and one other person a gift (\\#=#)}\n' +
+ ' other {{{sender.name}} gave {{recipients[0].name}} and # other people a gift (\\#=#)}\n' +
+ '}}';
var parsedFn = $interpolate(text, /*mustHaveExpression=*/true);
expect(parsedFn.expressions.length).toBe(1);
- expect(parsedFn.expressions[0]).toEqual("recipients.length");
+ expect(parsedFn.expressions[0]).toEqual('recipients.length');
$rootScope.recipients.length = 3;
// "#" should get replaced with the value of "recipients.length - offset"
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave Alice and 2 other people a gift (#=2)");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave Alice and 2 other people a gift (#=2)');
$rootScope.recipients.length = 2;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave Alice and one other person a gift (#=1)");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave Alice and one other person a gift (#=1)');
$rootScope.recipients.length = 1;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave one gift to Alice (#=0)");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave one gift to Alice (#=0)');
$rootScope.recipients.length = 0;
- expect(parsedFn($rootScope)).toEqual("Harry Potter gave no gifts (#=-1)");
+ expect(parsedFn($rootScope)).toEqual('Harry Potter gave no gifts (#=-1)');
});
});
it('nested plural and select', function() {
- var text = "" +
- "{{recipients.length, plural,\n" +
- " =0 {You gave no gifts}\n" +
- " =1 {{{recipients[0].gender, select,\n" +
- " male {You gave him a gift. -{{sender.name}}}\n" +
- " female {You gave her a gift. -{{sender.name}}}\n" +
- " other {You gave them a gift. -{{sender.name}}}\n" +
- " }}\n" +
- " }\n" +
- " other {You gave {{recipients.length}} people gifts. -{{sender.name}}}\n" +
- "}}";
+ var text = '' +
+ '{{recipients.length, plural,\n' +
+ ' =0 {You gave no gifts}\n' +
+ ' =1 {{{recipients[0].gender, select,\n' +
+ ' male {You gave him a gift. -{{sender.name}}}\n' +
+ ' female {You gave her a gift. -{{sender.name}}}\n' +
+ ' other {You gave them a gift. -{{sender.name}}}\n' +
+ ' }}\n' +
+ ' }\n' +
+ ' other {You gave {{recipients.length}} people gifts. -{{sender.name}}}\n' +
+ '}}';
var parsedFn = $interpolate(text, /*mustHaveExpression=*/true);
expect(parsedFn.expressions.length).toBe(1);
- expect(parsedFn.expressions[0]).toEqual("recipients.length");
+ expect(parsedFn.expressions[0]).toEqual('recipients.length');
var result = parsedFn($rootScope);
- expect(result).toEqual("You gave 3 people gifts. -Harry Potter");
+ expect(result).toEqual('You gave 3 people gifts. -Harry Potter');
});
});
@@ -217,11 +217,11 @@ describe('$$ngMessageFormat', function() {
}
it('should interpolate a plain string', function() {
- assertInterpolation(" Hello, world! ", " Hello, world! ");
+ assertInterpolation(' Hello, world! ', ' Hello, world! ');
});
it('should interpolate a simple expression', function() {
- assertInterpolation("Hello, {{sender.name}}!", "Hello, Harry Potter!");
+ assertInterpolation('Hello, {{sender.name}}!', 'Hello, Harry Potter!');
});
});
});
@@ -349,12 +349,12 @@ describe('$$ngMessageFormat', function() {
it('should ignore undefined model', inject(function($interpolate) {
- expect($interpolate("Hello {{'World'}}{{foo}}")({})).toBe('Hello World');
+ expect($interpolate('Hello {{\'World\'}}{{foo}}')({})).toBe('Hello World');
}));
it('should interpolate with undefined context', inject(function($interpolate) {
- expect($interpolate("Hello, world!{{bloop}}")()).toBe("Hello, world!");
+ expect($interpolate('Hello, world!{{bloop}}')()).toBe('Hello, world!');
}));
describe('watching', function() {
@@ -524,7 +524,7 @@ describe('$$ngMessageFormat', function() {
it('should NOT interpolate non-trusted expressions', inject(function($interpolate, $rootScope) {
var scope = $rootScope.$new();
- scope.foo = "foo";
+ scope.foo = 'foo';
expect(function() {
$interpolate('{{foo}}', true, sce.CSS)(scope);
@@ -533,7 +533,7 @@ describe('$$ngMessageFormat', function() {
it('should NOT interpolate mistyped expressions', inject(function($interpolate, $rootScope) {
var scope = $rootScope.$new();
- scope.foo = sce.trustAsCss("foo");
+ scope.foo = sce.trustAsCss('foo');
expect(function() {
$interpolate('{{foo}}', true, sce.HTML)(scope);
@@ -541,12 +541,12 @@ describe('$$ngMessageFormat', function() {
}));
it('should interpolate trusted expressions in a regular context', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
+ var foo = sce.trustAsCss('foo');
expect($interpolate('{{foo}}', true)({foo: foo})).toBe('foo');
}));
it('should interpolate trusted expressions in a specific trustedContext', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
+ var foo = sce.trustAsCss('foo');
expect($interpolate('{{foo}}', true, sce.CSS)({foo: foo})).toBe('foo');
}));
@@ -554,15 +554,15 @@ describe('$$ngMessageFormat', function() {
// instance, you can construct evil JS code by putting together pieces of JS strings that are by
// themselves safe to execute in isolation.)
it('should NOT interpolate trusted expressions with multiple parts', inject(function($interpolate) {
- var foo = sce.trustAsCss("foo");
- var bar = sce.trustAsCss("bar");
+ var foo = sce.trustAsCss('foo');
+ var bar = sce.trustAsCss('bar');
expect(function() {
return $interpolate('{{foo}}{{bar}}', true, sce.CSS)({foo: foo, bar: bar});
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{foo}}{{bar}}\n" +
- "Strict Contextual Escaping disallows interpolations that concatenate multiple " +
- "expressions when a trusted value is required. See " +
- "http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\n' +
+ 'Strict Contextual Escaping disallows interpolations that concatenate multiple ' +
+ 'expressions when a trusted value is required. See ' +
+ 'http://docs.angularjs.org/api/ng.$sce');
}));
});
@@ -584,50 +584,50 @@ describe('$$ngMessageFormat', function() {
describe('parseBindings', function() {
it('should Parse Text With No Bindings', inject(function($interpolate) {
- expect($interpolate("a").expressions).toEqual([]);
+ expect($interpolate('a').expressions).toEqual([]);
}));
it('should Parse Empty Text', inject(function($interpolate) {
- expect($interpolate("").expressions).toEqual([]);
+ expect($interpolate('').expressions).toEqual([]);
}));
it('should Parse Inner Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("a{{b}}C"),
+ var interpolateFn = $interpolate('a{{b}}C'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('a123C');
}));
it('should Parse Ending Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("a{{b}}"),
+ var interpolateFn = $interpolate('a{{b}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('a123');
}));
it('should Parse Begging Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}c"),
+ var interpolateFn = $interpolate('{{b}}c'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('123c');
}));
it('should Parse Loan Binding', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}"),
+ var interpolateFn = $interpolate('{{b}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b']);
expect(interpolateFn({b: 123})).toEqual('123');
}));
it('should Parse Two Bindings', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}{{c}}"),
+ var interpolateFn = $interpolate('{{b}}{{c}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b', 'c']);
expect(interpolateFn({b: 111, c: 222})).toEqual('111222');
}));
it('should Parse Two Bindings With Text In Middle', inject(function($interpolate) {
- var interpolateFn = $interpolate("{{b}}x{{c}}"),
+ var interpolateFn = $interpolate('{{b}}x{{c}}'),
expressions = interpolateFn.expressions;
expect(expressions).toEqual(['b', 'c']);
expect(interpolateFn({b: 111, c: 222})).toEqual('111x222');
@@ -648,21 +648,21 @@ describe('$$ngMessageFormat', function() {
expect(function() {
$interpolate('constant/{{var}}', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: constant/{{var}}\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: constant/{{var}}\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
expect(function() {
$interpolate('{{var}}/constant', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{var}}/constant\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{var}}/constant\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
expect(function() {
$interpolate('{{foo}}{{bar}}', true, isTrustedContext);
}).toThrowMinErr(
- "$interpolate", "noconcat", "Error while interpolating: {{foo}}{{bar}}\nStrict " +
- "Contextual Escaping disallows interpolations that concatenate multiple expressions " +
- "when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
+ '$interpolate', 'noconcat', 'Error while interpolating: {{foo}}{{bar}}\nStrict ' +
+ 'Contextual Escaping disallows interpolations that concatenate multiple expressions ' +
+ 'when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce');
}));
it('should interpolate a multi-part expression when isTrustedContext is false', inject(function($interpolate) {
diff --git a/test/ngMessages/messagesSpec.js b/test/ngMessages/messagesSpec.js
index 5bfbb0898c0d..a12a0ff11da8 100644
--- a/test/ngMessages/messagesSpec.js
+++ b/test/ngMessages/messagesSpec.js
@@ -342,21 +342,21 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(0);
- expect(trim(element.text())).toEqual("");
+ expect(trim(element.text())).toEqual('');
$rootScope.$apply(function() {
$rootScope.col = { hair: true };
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("Your hair is too long");
+ expect(trim(element.text())).toEqual('Your hair is too long');
$rootScope.$apply(function() {
$rootScope.col = { age: true, hair: true};
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("Your age is incorrect");
+ expect(trim(element.text())).toEqual('Your age is incorrect');
$rootScope.$apply(function() {
// remove the age!
@@ -364,7 +364,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("Your hair is too long");
+ expect(trim(element.text())).toEqual('Your hair is too long');
$rootScope.$apply(function() {
// remove the hair!
@@ -373,7 +373,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("Enter something");
+ expect(trim(element.text())).toEqual('Enter something');
}));
@@ -743,7 +743,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("A");
+ expect(trim(element.text())).toEqual('A');
$rootScope.$apply(function() {
$rootScope.data = {
@@ -752,7 +752,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("C");
+ expect(trim(element.text())).toEqual('C');
});
});
@@ -790,13 +790,13 @@ describe('ngMessages', function() {
$rootScope.$digest();
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("Your value is that of failure");
+ expect(trim(element.text())).toEqual('Your value is that of failure');
$httpBackend.flush();
$rootScope.$digest();
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("You did not enter a value");
+ expect(trim(element.text())).toEqual('You did not enter a value');
}));
it('should allow for overriding the remote template messages within the element depending on where the remote template is placed',
@@ -821,7 +821,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("AAA");
+ expect(trim(element.text())).toEqual('AAA');
$rootScope.$apply(function() {
$rootScope.data = {
@@ -831,7 +831,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("B");
+ expect(trim(element.text())).toEqual('B');
$rootScope.$apply(function() {
$rootScope.data = {
@@ -840,7 +840,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(1);
- expect(trim(element.text())).toEqual("C");
+ expect(trim(element.text())).toEqual('C');
}));
it('should properly detect a previous message, even if it was registered later',
@@ -934,7 +934,7 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(2);
- expect(s(element.text())).toContain("13");
+ expect(s(element.text())).toContain('13');
});
});
@@ -958,14 +958,14 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(2);
- expect(s(element.text())).toEqual("XZ");
+ expect(s(element.text())).toEqual('XZ');
$rootScope.$apply(function() {
$rootScope.data.y = {};
});
expect(messageChildren(element).length).toBe(3);
- expect(s(element.text())).toEqual("XYZ");
+ expect(s(element.text())).toEqual('XYZ');
}));
it('should render and override all truthy messages from a remote template',
@@ -990,14 +990,14 @@ describe('ngMessages', function() {
});
expect(messageChildren(element).length).toBe(2);
- expect(s(element.text())).toEqual("ZZZX");
+ expect(s(element.text())).toEqual('ZZZX');
$rootScope.$apply(function() {
$rootScope.data.y = {};
});
expect(messageChildren(element).length).toBe(3);
- expect(s(element.text())).toEqual("YYYZZZX");
+ expect(s(element.text())).toEqual('YYYZZZX');
}));
});
});
diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js
index c52c0758fc95..134b282515d1 100644
--- a/test/ngMock/angular-mocksSpec.js
+++ b/test/ngMock/angular-mocksSpec.js
@@ -172,7 +172,7 @@ describe('ngMock', function() {
$log.reset();
}));
- it("should skip debugging output if disabled (" + debugEnabled + ")", inject(function($log) {
+ it('should skip debugging output if disabled (' + debugEnabled + ')', inject(function($log) {
$log.log('fake log');
$log.info('fake log');
$log.warn('fake log');
@@ -432,10 +432,10 @@ describe('ngMock', function() {
expect($exceptionHandler.errors).toEqual([]);
$interval.flush(1000);
- expect($exceptionHandler.errors).toEqual(["Test Error"]);
+ expect($exceptionHandler.errors).toEqual(['Test Error']);
$interval.flush(1000);
- expect($exceptionHandler.errors).toEqual(["Test Error", "Test Error"]);
+ expect($exceptionHandler.errors).toEqual(['Test Error', 'Test Error']);
}));
@@ -626,7 +626,7 @@ describe('ngMock', function() {
module(function($exceptionHandlerProvider) {
expect(function() {
$exceptionHandlerProvider.mode('XXX');
- }).toThrowError("Unknown mode 'XXX', only 'log'/'rethrow' modes are allowed!");
+ }).toThrowError('Unknown mode \'XXX\', only \'log\'/\'rethrow\' modes are allowed!');
});
inject(); // Trigger the tests in `module`
@@ -1013,28 +1013,28 @@ describe('ngMock', function() {
it('should provide "expect" methods for each HTTP verb', function() {
- expect(typeof hb.expectGET).toBe("function");
- expect(typeof hb.expectPOST).toBe("function");
- expect(typeof hb.expectPUT).toBe("function");
- expect(typeof hb.expectPATCH).toBe("function");
- expect(typeof hb.expectDELETE).toBe("function");
- expect(typeof hb.expectHEAD).toBe("function");
+ expect(typeof hb.expectGET).toBe('function');
+ expect(typeof hb.expectPOST).toBe('function');
+ expect(typeof hb.expectPUT).toBe('function');
+ expect(typeof hb.expectPATCH).toBe('function');
+ expect(typeof hb.expectDELETE).toBe('function');
+ expect(typeof hb.expectHEAD).toBe('function');
});
it('should provide "when" methods for each HTTP verb', function() {
- expect(typeof hb.whenGET).toBe("function");
- expect(typeof hb.whenPOST).toBe("function");
- expect(typeof hb.whenPUT).toBe("function");
- expect(typeof hb.whenPATCH).toBe("function");
- expect(typeof hb.whenDELETE).toBe("function");
- expect(typeof hb.whenHEAD).toBe("function");
+ expect(typeof hb.whenGET).toBe('function');
+ expect(typeof hb.whenPOST).toBe('function');
+ expect(typeof hb.whenPUT).toBe('function');
+ expect(typeof hb.whenPATCH).toBe('function');
+ expect(typeof hb.whenDELETE).toBe('function');
+ expect(typeof hb.whenHEAD).toBe('function');
});
it('should provide "route" shortcuts for expect and when', function() {
- expect(typeof hb.whenRoute).toBe("function");
- expect(typeof hb.expectRoute).toBe("function");
+ expect(typeof hb.whenRoute).toBe('function');
+ expect(typeof hb.expectRoute).toBe('function');
});
@@ -1342,7 +1342,7 @@ describe('ngMock', function() {
it('should decode query parameters in respond() function', function() {
hb.expect('GET', '/url?query=l%E2%80%A2ng%20string%20w%2F%20spec%5Eal%20char%24&id=1234&orderBy=-name')
.respond(function(m, u, d, h, p) {
- return [200, "id=" + p.id + ";orderBy=" + p.orderBy + ";query=" + p.query];
+ return [200, 'id=' + p.id + ';orderBy=' + p.orderBy + ';query=' + p.query];
});
hb('GET', '/url?query=l%E2%80%A2ng%20string%20w%2F%20spec%5Eal%20char%24&id=1234&orderBy=-name', null, callback);
@@ -1354,7 +1354,7 @@ describe('ngMock', function() {
it('should include regex captures in respond() params when keys provided', function() {
hb.expect('GET', /\/(.+)\/article\/(.+)/, undefined, undefined, ['id', 'name'])
.respond(function(m, u, d, h, p) {
- return [200, "id=" + p.id + ";name=" + p.name];
+ return [200, 'id=' + p.id + ';name=' + p.name];
});
hb('GET', '/1234/article/cool-angular-article', null, callback);
@@ -1491,7 +1491,7 @@ describe('ngMock', function() {
});
- it("should use when's respond() when no expect() respond is defined", function() {
+ it('should use when\'s respond() when no expect() respond is defined', function() {
callback.and.callFake(function(status, response) {
expect(status).toBe(201);
expect(response).toBe('data');
@@ -1848,7 +1848,7 @@ describe('ngMock', function() {
expect(exp.matchData({})).toBe(false);
expect(exp.match('POST', '/url', '{"id": "xxx", "status": "N"}')).toBe(true);
- expect(exp.match('POST', '/url', {"id": "xxx", "status": "N"})).toBe(true);
+ expect(exp.match('POST', '/url', {'id': 'xxx', 'status': 'N'})).toBe(true);
});
@@ -2856,42 +2856,42 @@ describe('sharedInjector', function() {
// we use the 'module' and 'inject' globals from ngMock
- it("allowes me to mutate a single instace of a module (proving it has been shared)", ngMockTest(function() {
- sdescribe("test state is shared", function() {
- angular.module("sharedInjectorTestModuleA", [])
- .factory("testService", function() {
+ it('allowes me to mutate a single instace of a module (proving it has been shared)', ngMockTest(function() {
+ sdescribe('test state is shared', function() {
+ angular.module('sharedInjectorTestModuleA', [])
+ .factory('testService', function() {
return { state: 0 };
});
module.sharedInjector();
- sbeforeAll(module("sharedInjectorTestModuleA"));
+ sbeforeAll(module('sharedInjectorTestModuleA'));
- sit("access and mutate", inject(function(testService) {
+ sit('access and mutate', inject(function(testService) {
testService.state += 1;
}));
- sit("expect mutation to have persisted", inject(function(testService) {
+ sit('expect mutation to have persisted', inject(function(testService) {
expect(testService.state).toEqual(1);
}));
});
}));
- it("works with standard beforeEach", ngMockTest(function() {
- sdescribe("test state is not shared", function() {
- angular.module("sharedInjectorTestModuleC", [])
- .factory("testService", function() {
+ it('works with standard beforeEach', ngMockTest(function() {
+ sdescribe('test state is not shared', function() {
+ angular.module('sharedInjectorTestModuleC', [])
+ .factory('testService', function() {
return { state: 0 };
});
- sbeforeEach(module("sharedInjectorTestModuleC"));
+ sbeforeEach(module('sharedInjectorTestModuleC'));
- sit("access and mutate", inject(function(testService) {
+ sit('access and mutate', inject(function(testService) {
testService.state += 1;
}));
- sit("expect mutation not to have persisted", inject(function(testService) {
+ sit('expect mutation not to have persisted', inject(function(testService) {
expect(testService.state).toEqual(0);
}));
});
@@ -2899,70 +2899,70 @@ describe('sharedInjector', function() {
it('allows me to stub with shared injector', ngMockTest(function() {
- sdescribe("test state is shared", function() {
- angular.module("sharedInjectorTestModuleD", [])
- .value("testService", 43);
+ sdescribe('test state is shared', function() {
+ angular.module('sharedInjectorTestModuleD', [])
+ .value('testService', 43);
module.sharedInjector();
- sbeforeAll(module("sharedInjectorTestModuleD", function($provide) {
- $provide.value("testService", 42);
+ sbeforeAll(module('sharedInjectorTestModuleD', function($provide) {
+ $provide.value('testService', 42);
}));
- sit("expected access stubbed value", inject(function(testService) {
+ sit('expected access stubbed value', inject(function(testService) {
expect(testService).toEqual(42);
}));
});
}));
- it("doesn't interfere with other test describes", ngMockTest(function() {
- angular.module("sharedInjectorTestModuleE", [])
- .factory("testService", function() {
+ it('doesn\'t interfere with other test describes', ngMockTest(function() {
+ angular.module('sharedInjectorTestModuleE', [])
+ .factory('testService', function() {
return { state: 0 };
});
- sdescribe("with stubbed injector", function() {
+ sdescribe('with stubbed injector', function() {
module.sharedInjector();
- sbeforeAll(module("sharedInjectorTestModuleE"));
+ sbeforeAll(module('sharedInjectorTestModuleE'));
- sit("access and mutate", inject(function(testService) {
+ sit('access and mutate', inject(function(testService) {
expect(testService.state).toEqual(0);
testService.state += 1;
}));
- sit("expect mutation to have persisted", inject(function(testService) {
+ sit('expect mutation to have persisted', inject(function(testService) {
expect(testService.state).toEqual(1);
}));
});
- sdescribe("without stubbed injector", function() {
- sbeforeEach(module("sharedInjectorTestModuleE"));
+ sdescribe('without stubbed injector', function() {
+ sbeforeEach(module('sharedInjectorTestModuleE'));
- sit("access and mutate", inject(function(testService) {
+ sit('access and mutate', inject(function(testService) {
expect(testService.state).toEqual(0);
testService.state += 1;
}));
- sit("expect original, unmutated value", inject(function(testService) {
+ sit('expect original, unmutated value', inject(function(testService) {
expect(testService.state).toEqual(0);
}));
});
}));
- it("prevents nested use of sharedInjector()", function() {
+ it('prevents nested use of sharedInjector()', function() {
var test = ngMockTest(function() {
- sdescribe("outer", function() {
+ sdescribe('outer', function() {
module.sharedInjector();
- sdescribe("inner", function() {
+ sdescribe('inner', function() {
module.sharedInjector();
- sit("should not get here", function() {
- throw Error("should have thrown before here!");
+ sit('should not get here', function() {
+ throw Error('should have thrown before here!');
});
});
@@ -2986,9 +2986,9 @@ describe('sharedInjector', function() {
if (re.test(e.message)) {
return;
}
- throw Error("thrown error '" + e.message + "' did not match:" + re);
+ throw Error('thrown error \'' + e.message + '\' did not match:' + re);
}
- throw Error("should have thrown error");
+ throw Error('should have thrown error');
}
// run a set of test cases in the sdescribe stub test framework
@@ -3002,7 +3002,7 @@ describe('sharedInjector', function() {
module.$$beforeAllHook = sbeforeAll;
module.$$afterAllHook = safterAll;
- sdescribe.root = sdescribe("root", function() {});
+ sdescribe.root = sdescribe('root', function() {});
sdescribe.root.beforeEach.push(module.$$beforeEach);
sdescribe.root.afterEach.push(module.$$afterEach);
@@ -3045,21 +3045,21 @@ describe('sharedInjector', function() {
self.run = function() {
var spec = {};
- self.hooks("beforeAll", spec);
+ self.hooks('beforeAll', spec);
self.tests.forEach(function(test) {
- if (self.parent) self.parent.hooks("beforeEach", spec);
- self.hooks("beforeEach", spec);
+ if (self.parent) self.parent.hooks('beforeEach', spec);
+ self.hooks('beforeEach', spec);
test.run.call(spec);
- self.hooks("afterEach", spec);
- if (self.parent) self.parent.hooks("afterEach", spec);
+ self.hooks('afterEach', spec);
+ if (self.parent) self.parent.hooks('afterEach', spec);
});
self.describes.forEach(function(d) {
d.run();
});
- self.hooks("afterAll", spec);
+ self.hooks('afterAll', spec);
};
self.hooks = function(hook, spec) {
@@ -3076,7 +3076,7 @@ describe('sharedInjector', function() {
}
function sit(name, fn) {
- if (typeof fn !== "function") throw Error("not fn", fn);
+ if (typeof fn !== 'function') throw Error('not fn', fn);
sdescribe.current.tests.push({
name: name,
run: fn
@@ -3084,22 +3084,22 @@ describe('sharedInjector', function() {
}
function sbeforeAll(fn) {
- if (typeof fn !== "function") throw Error("not fn", fn);
+ if (typeof fn !== 'function') throw Error('not fn', fn);
sdescribe.current.beforeAll.push(fn);
}
function safterAll(fn) {
- if (typeof fn !== "function") throw Error("not fn", fn);
+ if (typeof fn !== 'function') throw Error('not fn', fn);
sdescribe.current.afterAll.push(fn);
}
function sbeforeEach(fn) {
- if (typeof fn !== "function") throw Error("not fn", fn);
+ if (typeof fn !== 'function') throw Error('not fn', fn);
sdescribe.current.beforeEach.push(fn);
}
function safterEach(fn) {
- if (typeof fn !== "function") throw Error("not fn", fn);
+ if (typeof fn !== 'function') throw Error('not fn', fn);
sdescribe.current.afterEach.push(fn);
}
});
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js
index 40e9df6b5695..7a142a43f7b2 100644
--- a/test/ngResource/resourceSpec.js
+++ b/test/ngResource/resourceSpec.js
@@ -1,8 +1,8 @@
'use strict';
-describe("resource", function() {
+describe('resource', function() {
-describe("basic usage", function() {
+describe('basic usage', function() {
var $resource, CreditCard, callback, $httpBackend, resourceProvider;
beforeEach(module('ngResource'));
@@ -98,7 +98,7 @@ describe("basic usage", function() {
});
- it("should build resource", function() {
+ it('should build resource', function() {
expect(typeof CreditCard).toBe('function');
expect(typeof CreditCard.get).toBe('function');
expect(typeof CreditCard.save).toBe('function');
@@ -140,14 +140,14 @@ describe("basic usage", function() {
it('should omit properties from prototype chain', function() {
var original, clone = {};
function Func() {}
- Func.prototype.hello = "world";
+ Func.prototype.hello = 'world';
original = new Func();
- original.goodbye = "world";
+ original.goodbye = 'world';
expect(shallowClearAndCopy(original, clone)).toBe(clone);
expect(clone.hello).toBeUndefined();
- expect(clone.goodbye).toBe("world");
+ expect(clone.goodbye).toBe('world');
});
});
@@ -403,7 +403,7 @@ describe("basic usage", function() {
});
- it("should build resource with action default param overriding default param", function() {
+ it('should build resource with action default param overriding default param', function() {
$httpBackend.expect('GET', '/Customer/123').respond({id: 'abc'});
var TypeItem = $resource('/:type/:typeId', {type: 'Order'},
{get: {method: 'GET', params: {type: 'Customer'}}});
@@ -448,11 +448,11 @@ describe("basic usage", function() {
it('should throw an exception if a param is called "hasOwnProperty"', function() {
expect(function() {
$resource('/:hasOwnProperty').get();
- }).toThrowMinErr('$resource','badname', "hasOwnProperty is not a valid parameter name");
+ }).toThrowMinErr('$resource','badname', 'hasOwnProperty is not a valid parameter name');
});
- it("should create resource", function() {
+ it('should create resource', function() {
$httpBackend.expect('POST', '/CreditCard', '{"name":"misko"}').respond({id: 123, name: 'misko'});
var cc = CreditCard.save({name: 'misko'}, callback);
@@ -467,7 +467,7 @@ describe("basic usage", function() {
});
- it("should read resource", function() {
+ it('should read resource', function() {
$httpBackend.expect('GET', '/CreditCard/123').respond({id: 123, number: '9876'});
var cc = CreditCard.get({id: 123}, callback);
@@ -484,14 +484,14 @@ describe("basic usage", function() {
it('should send correct headers', function() {
$httpBackend.expectPUT('/CreditCard/123', undefined, function(headers) {
- return headers['If-None-Match'] === "*";
+ return headers['If-None-Match'] === '*';
}).respond({id:123});
CreditCard.conditionalPut({id: {key:123}});
});
- it("should read partial resource", function() {
+ it('should read partial resource', function() {
$httpBackend.expect('GET', '/CreditCard').respond([{id:{key:123}}]);
var ccs = CreditCard.query();
@@ -511,7 +511,7 @@ describe("basic usage", function() {
});
- it("should update resource", function() {
+ it('should update resource', function() {
$httpBackend.expect('POST', '/CreditCard/123', '{"id":{"key":123},"name":"misko"}').
respond({id: {key: 123}, name: 'rama'});
@@ -522,7 +522,7 @@ describe("basic usage", function() {
});
- it("should query resource", function() {
+ it('should query resource', function() {
$httpBackend.expect('GET', '/CreditCard?key=value').respond([{id: 1}, {id: 2}]);
var ccs = CreditCard.query({key: 'value'}, callback);
@@ -536,7 +536,7 @@ describe("basic usage", function() {
});
- it("should have all arguments optional", function() {
+ it('should have all arguments optional', function() {
$httpBackend.expect('GET', '/CreditCard').respond([{id:1}]);
var log = '';
@@ -583,7 +583,7 @@ describe("basic usage", function() {
});
- it("should patch a resource", function() {
+ it('should patch a resource', function() {
$httpBackend.expectPATCH('/CreditCard/123', '{"name":"igor"}').
respond({id: 123, name: 'rama'});
@@ -1228,10 +1228,10 @@ describe("basic usage", function() {
});
it('should not convert string literals in array into Resource objects', function() {
- $httpBackend.expect('GET', '/names.json').respond(["mary", "jane"]);
+ $httpBackend.expect('GET', '/names.json').respond(['mary', 'jane']);
var strings = $resource('/names.json').query();
$httpBackend.flush();
- expect(strings).toEqualData(["mary", "jane"]);
+ expect(strings).toEqualData(['mary', 'jane']);
});
it('should not convert number literals in array into Resource objects', function() {
@@ -1288,7 +1288,7 @@ describe("basic usage", function() {
});
});
- describe("save", function() {
+ describe('save', function() {
it('should append the suffix', function() {
$httpBackend.expect('POST', '/users.json', '{"name":"user1"}').respond({id: 123, name: 'user1'});
var UserService = $resource('/users/:user_id.json', {user_id: '@id'});
diff --git a/test/ngRoute/directive/ngViewSpec.js b/test/ngRoute/directive/ngViewSpec.js
index 37ce71d33071..d201ff331dac 100644
--- a/test/ngRoute/directive/ngViewSpec.js
+++ b/test/ngRoute/directive/ngViewSpec.js
@@ -633,7 +633,7 @@ describe('ngView', function() {
});
});
- it("should compile its content correctly (although we remove it later)", function() {
+ it('should compile its content correctly (although we remove it later)', function() {
var testElement;
module(function($compileProvider, $routeProvider) {
$routeProvider.when('/view', {template: ' '});
diff --git a/test/ngRoute/routeSpec.js b/test/ngRoute/routeSpec.js
index 5a0780f5efbf..dd325e10e580 100644
--- a/test/ngRoute/routeSpec.js
+++ b/test/ngRoute/routeSpec.js
@@ -403,7 +403,7 @@ describe('$route', function() {
expect($route.current).toBeDefined();
}));
- it("should use route params inherited from prototype chain", function() {
+ it('should use route params inherited from prototype chain', function() {
function BaseRoute() {}
BaseRoute.prototype.templateUrl = 'foo.html';
@@ -882,7 +882,7 @@ describe('$route', function() {
$rootScope.$digest();
$httpBackend.flush();
- expect($exceptionHandler.errors.pop().message).toContain("[$compile:tpload] Failed to load template: r1.html");
+ expect($exceptionHandler.errors.pop().message).toContain('[$compile:tpload] Failed to load template: r1.html');
$httpBackend.expectGET('r2.html').respond('');
$location.path('/r2');
diff --git a/test/ngSanitize/filter/linkySpec.js b/test/ngSanitize/filter/linkySpec.js
index eee62d237ee8..4599c1ee48ab 100644
--- a/test/ngSanitize/filter/linkySpec.js
+++ b/test/ngSanitize/filter/linkySpec.js
@@ -10,7 +10,7 @@ describe('linky', function() {
}));
it('should do basic filter', function() {
- expect(linky("http://ab/ (http://a/) http://1.2/v:~-123. c “http://example.com” ‘http://me.com’")).
+ expect(linky('http://ab/ (http://a/) http://1.2/v:~-123. c “http://example.com” ‘http://me.com’')).
toEqual(' http://ab/ ' +
'(
http://a/ ) ' +
'<
http://a/ > ' +
@@ -65,13 +65,13 @@ describe('linky', function() {
});
it('should handle mailto:', function() {
- expect(linky("mailto:me@example.com")).
+ expect(linky('mailto:me@example.com')).
toEqual('
me@example.com ');
- expect(linky("me@example.com")).
+ expect(linky('me@example.com')).
toEqual('
me@example.com ');
- expect(linky("send email to me@example.com, but")).
+ expect(linky('send email to me@example.com, but')).
toEqual('send email to
me@example.com , but');
- expect(linky("my email is \"me@example.com\"")).
+ expect(linky('my email is "me@example.com"')).
toEqual('my email is "
me@example.com "');
});
@@ -80,10 +80,10 @@ describe('linky', function() {
});
it('should handle target:', function() {
- expect(linky("http://example.com", "_blank")).
+ expect(linky('http://example.com', '_blank')).
toBeOneOf('
http://example.com ',
'
http://example.com ');
- expect(linky("http://example.com", "someNamedIFrame")).
+ expect(linky('http://example.com', 'someNamedIFrame')).
toBeOneOf('
http://example.com ',
'
http://example.com ');
});
@@ -91,21 +91,21 @@ describe('linky', function() {
describe('custom attributes', function() {
it('should optionally add custom attributes', function() {
- expect(linky("http://example.com", "_self", {rel: "nofollow"})).
+ expect(linky('http://example.com', '_self', {rel: 'nofollow'})).
toBeOneOf('
http://example.com ',
'
http://example.com ');
});
it('should override target parameter with custom attributes', function() {
- expect(linky("http://example.com", "_self", {target: "_blank"})).
+ expect(linky('http://example.com', '_self', {target: '_blank'})).
toBeOneOf('
http://example.com ',
'
http://example.com ');
});
it('should optionally add custom attributes from function', function() {
- expect(linky("http://example.com", "_self", function(url) {return {"class": "blue"};})).
+ expect(linky('http://example.com', '_self', function(url) {return {'class': 'blue'};})).
toBeOneOf('
http://example.com ',
'
http://example.com ',
'
http://example.com ');
@@ -113,21 +113,21 @@ describe('linky', function() {
it('should pass url as parameter to custom attribute function', function() {
- var linkParameters = jasmine.createSpy('linkParameters').and.returnValue({"class": "blue"});
- linky("http://example.com", "_self", linkParameters);
+ var linkParameters = jasmine.createSpy('linkParameters').and.returnValue({'class': 'blue'});
+ linky('http://example.com', '_self', linkParameters);
expect(linkParameters).toHaveBeenCalledWith('http://example.com');
});
it('should call the attribute function for all links in the input', function() {
var attributeFn = jasmine.createSpy('attributeFn').and.returnValue({});
- linky("http://example.com and http://google.com", "_self", attributeFn);
+ linky('http://example.com and http://google.com', '_self', attributeFn);
expect(attributeFn.calls.allArgs()).toEqual([['http://example.com'], ['http://google.com']]);
});
it('should strip unsafe attributes', function() {
- expect(linky("http://example.com", "_self", {"class": "blue", "onclick": "alert('Hi')"})).
+ expect(linky('http://example.com', '_self', {'class': 'blue', 'onclick': 'alert(\'Hi\')'})).
toBeOneOf('
http://example.com ',
'
http://example.com ',
'
http://example.com ');
diff --git a/test/ngSanitize/sanitizeSpec.js b/test/ngSanitize/sanitizeSpec.js
index 5794d06e17a8..3c6e63829ec9 100644
--- a/test/ngSanitize/sanitizeSpec.js
+++ b/test/ngSanitize/sanitizeSpec.js
@@ -22,7 +22,7 @@ describe('HTML', function() {
var handler, start, text, comment;
beforeEach(function() {
- text = "";
+ text = '';
start = null;
handler = {
start: function(tag, attrs) {
@@ -347,7 +347,7 @@ describe('HTML', function() {
});
it('should ignore unknown attributes', function() {
- writer.start('div', {unknown:""});
+ writer.start('div', {unknown:''});
expect(html).toEqual('
');
});
diff --git a/test/ngScenario/ApplicationSpec.js b/test/ngScenario/ApplicationSpec.js
index a6343cea424a..176f5b0a8ce0 100644
--- a/test/ngScenario/ApplicationSpec.js
+++ b/test/ngScenario/ApplicationSpec.js
@@ -10,7 +10,7 @@ describe('angular.scenario.Application', function() {
beforeEach(function() {
window.document.body.innerHTML = '';
- frames = _jQuery("
");
+ frames = _jQuery('
');
_jQuery(window.document.body).append(frames);
app = new angular.scenario.Application(frames);
});
@@ -134,7 +134,7 @@ describe('angular.scenario.Application', function() {
var injectorGet = $injector.get;
spyOn($injector, 'get').and.callFake(function(name) {
switch (name) {
- case "$rootElement": return jqLite(testWindow.document);
+ case '$rootElement': return jqLite(testWindow.document);
default: return injectorGet(name);
}
});
@@ -164,7 +164,7 @@ describe('angular.scenario.Application', function() {
var injectorGet = $injector.get;
var injectorSpy = spyOn($injector, 'get').and.callFake(function(name) {
switch (name) {
- case "$rootElement": return jqLite(testWindow.document);
+ case '$rootElement': return jqLite(testWindow.document);
default: return injectorGet(name);
}
});
@@ -183,7 +183,7 @@ describe('angular.scenario.Application', function() {
testWindow.angular.resumeDeferredBootstrap();
expect(app.rootElement).toBe(testWindow.document);
expect(resumeBootstrapSpy).toHaveBeenCalled();
- expect(injectorSpy).toHaveBeenCalledWith("$rootElement");
+ expect(injectorSpy).toHaveBeenCalledWith('$rootElement');
dealoc(testWindow.document);
}));
diff --git a/test/ngScenario/RunnerSpec.js b/test/ngScenario/RunnerSpec.js
index 9f62504409b1..3de151a55d27 100644
--- a/test/ngScenario/RunnerSpec.js
+++ b/test/ngScenario/RunnerSpec.js
@@ -103,7 +103,7 @@ describe('angular.scenario.Runner', function() {
$window.describe('describe', function() {
$window.it('1', function() {
var scope = $window.dslScope();
- scope.test = "foo";
+ scope.test = 'foo';
expect($window.dslScope().test).toBeUndefined();
});
$window.it('2', function() {
diff --git a/test/ngScenario/ScenarioSpec.js b/test/ngScenario/ScenarioSpec.js
index a8e5280b5784..d3451a2ba327 100644
--- a/test/ngScenario/ScenarioSpec.js
+++ b/test/ngScenario/ScenarioSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("ScenarioSpec: Compilation", function() {
+describe('ScenarioSpec: Compilation', function() {
var element;
afterEach(function() {
@@ -9,7 +9,7 @@ describe("ScenarioSpec: Compilation", function() {
describe('compilation', function() {
- it("should compile dom node and return scope", inject(function($rootScope, $compile) {
+ it('should compile dom node and return scope', inject(function($rootScope, $compile) {
var node = jqLite('
{{b=a+1}}
')[0];
element = $compile(node)($rootScope);
$rootScope.$digest();
@@ -17,13 +17,13 @@ describe("ScenarioSpec: Compilation", function() {
expect($rootScope.b).toEqual(2);
}));
- it("should compile jQuery node and return scope", inject(function($rootScope, $compile) {
+ it('should compile jQuery node and return scope', inject(function($rootScope, $compile) {
element = $compile(jqLite('
{{a=123}}
'))($rootScope);
$rootScope.$digest();
expect(jqLite(element).text()).toEqual('123');
}));
- it("should compile text node and return scope", inject(function($rootScope, $compile) {
+ it('should compile text node and return scope', inject(function($rootScope, $compile) {
element = $compile('
{{a=123}}
')($rootScope);
$rootScope.$digest();
expect(jqLite(element).text()).toEqual('123');
diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js
index 700270af8574..a34d59d20d8d 100644
--- a/test/ngScenario/dslSpec.js
+++ b/test/ngScenario/dslSpec.js
@@ -1,6 +1,6 @@
'use strict';
-describe("angular.scenario.dsl", function() {
+describe('angular.scenario.dsl', function() {
var element;
var $window, $root;
var eventLog;
@@ -765,7 +765,7 @@ describe("angular.scenario.dsl", function() {
it('should return value in text input', function() {
doc.append('
');
$root.dsl.input('test.input').val();
- expect($root.futureResult).toEqual("something");
+ expect($root.futureResult).toEqual('something');
});
});
});
diff --git a/test/ngScenario/e2e/widgets-scenario.js b/test/ngScenario/e2e/widgets-scenario.js
index 3d7a3e383645..40b176d1b30a 100644
--- a/test/ngScenario/e2e/widgets-scenario.js
+++ b/test/ngScenario/e2e/widgets-scenario.js
@@ -32,18 +32,18 @@ describe('widgets', function() {
expect(binding('button').fromJson()).toEqual({'count': 0});
expect(binding('form').fromJson()).toEqual({'count': 0});
- element('form a', "'action' link").click();
+ element('form a', '\'action\' link').click();
expect(binding('button').fromJson()).toEqual({'count': 1});
- element('input[value="submit input"]', "'submit input' button").click();
+ element('input[value="submit input"]', '\'submit input\' button').click();
expect(binding('button').fromJson()).toEqual({'count': 2});
expect(binding('form').fromJson()).toEqual({'count': 1});
- element('button:contains("submit button")', "'submit button' button").click();
+ element('button:contains("submit button")', '\'submit button\' button').click();
expect(binding('button').fromJson()).toEqual({'count': 2});
expect(binding('form').fromJson()).toEqual({'count': 2});
- element('input[value="button"]', "'button' button").click();
+ element('input[value="button"]', '\'button\' button').click();
expect(binding('button').fromJson()).toEqual({'count': 3});
element('input[type="image"]', 'form image').click();
diff --git a/test/ngScenario/matchersSpec.js b/test/ngScenario/matchersSpec.js
index d8a62a02d4bd..7b68d2b9b731 100644
--- a/test/ngScenario/matchersSpec.js
+++ b/test/ngScenario/matchersSpec.js
@@ -34,7 +34,7 @@ describe('angular.scenario.matchers', function() {
expectMatcher(10, function() { matchers.toEqual(10); });
expectMatcher('value', function() { matchers.toBeDefined(); });
expectMatcher([1], function() { matchers.toBeTruthy(); });
- expectMatcher("", function() { matchers.toBeFalsy(); });
+ expectMatcher('', function() { matchers.toBeFalsy(); });
expectMatcher(0, function() { matchers.toBeFalsy(); });
expectMatcher('foo', function() { matchers.toMatch('.o.'); });
expectMatcher(null, function() { matchers.toBeNull(); });
diff --git a/test/ngScenario/output/HtmlSpec.js b/test/ngScenario/output/HtmlSpec.js
index 295fa45eaa54..541d4d4afadf 100644
--- a/test/ngScenario/output/HtmlSpec.js
+++ b/test/ngScenario/output/HtmlSpec.js
@@ -24,7 +24,7 @@ describe('angular.scenario.output.html', function() {
};
runner = new angular.scenario.testing.MockRunner();
model = new angular.scenario.ObjectModel(runner);
- context = _jQuery("
");
+ context = _jQuery('
');
ui = angular.scenario.output.html(context, runner, model);
});
diff --git a/validate-commit-msg.spec.js b/validate-commit-msg.spec.js
index a00102174b5b..5a8ab1dc409e 100644
--- a/validate-commit-msg.spec.js
+++ b/validate-commit-msg.spec.js
@@ -44,7 +44,7 @@ describe('validate-commit-msg.js', function() {
it('should validate 100 characters length', function() {
- var msg = "fix($compile): something super mega extra giga tera long, maybe even longer and longer and longer... ";
+ var msg = 'fix($compile): something super mega extra giga tera long, maybe even longer and longer and longer... ';
expect(m.validateMessage(msg)).toBe(INVALID);
expect(errors).toEqual(['INVALID COMMIT MSG: is longer than 100 characters !']);