Skip to content

Commit 4fa5871

Browse files
chirayukjamesdaily
authored andcommitted
test($sce): make ie8 happy
Ref: angular#4221 Closes angular#4221
1 parent e03aac8 commit 4fa5871

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/ng/sceSpecs.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ describe('SCE', function() {
262262
$sceDelegateProvider.resourceUrlBlacklist(cfg.blackList);
263263
}
264264
});
265-
inject(testFn);
265+
// This needs to be angular.mock.inject even though it's === window.inject.
266+
// Ref: https://github.com/angular/angular.js/pull/4221#/issuecomment-25515813
267+
angular.mock.inject(testFn);
266268
}
267269
}
268270

@@ -288,15 +290,13 @@ describe('SCE', function() {
288290
'$sce', 'insecurl', 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: foo');
289291
}));
290292

291-
if (!msie || msie > 8) {
292-
it('should not accept unknown matcher type', function() {
293-
expect(function() {
294-
runTest({whiteList: [{}]}, null)();
295-
}).toThrowMinErr('$injector', 'modulerr', new RegExp(
296-
/Failed to instantiate module function ?\(\$sceDelegateProvider\) due to:\n/.source +
297-
/[^[]*\[\$sce:imatcher\] Matchers may only be "self", string patterns or RegExp objects/.source));
298-
});
299-
}
293+
it('should not accept unknown matcher type', function() {
294+
expect(function() {
295+
runTest({whiteList: [{}]}, null)();
296+
}).toThrowMinErr('$injector', 'modulerr', new RegExp(
297+
/Failed to instantiate module function ?\(\$sceDelegateProvider\) due to:\n/.source +
298+
/[^[]*\[\$sce:imatcher\] Matchers may only be "self", string patterns or RegExp objects/.source));
299+
});
300300

301301
describe('adjustMatcher', function() {
302302
it('should rewrite regex into regex and add ^ & $ on either end', function() {

0 commit comments

Comments
 (0)