Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 935bd29

Browse filesBrowse files
committed
add 'unpolyfill' jasmine test asset
- that override DOM methods to catch browser-dependent (i.e. IE) bugs
1 parent 8521f37 commit 935bd29
Copy full SHA for 935bd29

File tree

Expand file treeCollapse file tree

2 files changed

+24
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+24
-1
lines changed

‎test/jasmine/assets/unpolyfill.js

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Un-polyfills - to be included in karma.conf.js to catch
3+
* browser-dependent errors.
4+
*/
5+
6+
'use strict';
7+
8+
(function(arr) {
9+
arr.forEach(function(item) {
10+
Object.defineProperty(item, 'remove', {
11+
configurable: true,
12+
enumerable: true,
13+
writable: true,
14+
value: function remove() {
15+
throw Error([
16+
'test/jasmine/assets/unpolyfill.js error: calling ChildNode.remove()',
17+
'which is not available in IE.'
18+
].join(' '));
19+
}
20+
});
21+
});
22+
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);

‎test/jasmine/karma.conf.js

Copy file name to clipboardExpand all lines: test/jasmine/karma.conf.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ var pathToStrictD3 = path.join(__dirname, '..', '..', 'tasks', 'util', 'strict_d
106106
var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
107107
var pathToIE9mock = path.join(__dirname, 'assets', 'ie9_mock.js');
108108
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
109+
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
109110

110111
var reporters = (isFullSuite && !argv.tags) ? ['dots', 'spec'] : ['progress'];
111112
if(argv.failFast) reporters.push('fail-fast');
@@ -142,7 +143,7 @@ func.defaultConfig = {
142143
// list of files / patterns to load in the browser
143144
//
144145
// N.B. the rest of this field is filled below
145-
files: [pathToCustomMatchers],
146+
files: [pathToCustomMatchers, pathToUnpolyfill],
146147

147148
// list of files / pattern to exclude
148149
exclude: [],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.