1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Underscore Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
iframe {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="map-test">
<div id="id1"></div>
<div id="id2"></div>
</div>
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
</div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script>
QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
// excuse tests we intentionally fail or those with problems
QUnit.config.excused = {
'Arrays': {
'union': [
'[null,1,2,3]'
]
},
'Chaining': {
'select/reject/sortBy': [
'Died on test #1'
],
'select/reject/sortBy in functional style': [
'Died on test #1'
],
'reverse/concat/unshift/pop/map': [
'"34, 10, 8, 6, 4, 2, 10, 10"'
]
},
'Collections': {
'reduce': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'reduceRight': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'where': [
'Only get the first object matched.'
]
},
'Functions': {
'bind': [
'can bind without specifying a context',
'Died on test #2'
],
'bindAll': [
'throws an error for bindAll with no functions named'
],
'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': true,
'throttle does not trigger trailing call when trailing is set to false': true,
'debounce asap': true
},
'Objects': {
'isEqual': [
'Died on test #60',
'Died on test #63'
],
'keys': [
'throws an error for `null` values',
'throws an error for `undefined` values',
'throws an error for number primitives',
'throws an error for string primitives',
'throws an error for boolean primitives'
]
},
'Utility': {
'_.escape': [
'"<a href="http://moe.com">Curly & Moe's</a>"'
],
'_.unescape': [
'"<a href=\\"http://moe.com\\">Curly & Moe's</a>"'
],
'times': [
'Died on test #1'
],
'uniqueId': [
'Died on test #1'
]
}
};
// only excuse in Sauce Labs (buggy Safari and timers)
if (location.port != '9001') {
delete QUnit.config.excused.Chaining['select/reject/sortBy'];
delete QUnit.config.excused.Chaining['select/reject/sortBy in functional style'];
delete QUnit.config.excused.Functions['throttle repeatedly with results'];
delete QUnit.config.excused.Functions['more throttle does not trigger leading call when leading is set to false'];
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
delete QUnit.config.excused.Functions['debounce asap'];
delete QUnit.config.excused.Objects.isEqual;
delete QUnit.config.excused.Utility.times;
delete QUnit.config.excused.Utility.uniqueId;
}
// only excuse in non-Underscore builds
if (/\bunderscore\b/i.test(ui.buildPath)) {
delete QUnit.config.excused.Chaining;
delete QUnit.config.excused.Collections.where;
delete QUnit.config.excused.Utility['_.escape'];
delete QUnit.config.excused.Utility['_.unescape'];
}
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
// load Lo-Dash and test scripts
document.write(ui.urlParams.loader != 'none'
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
: ([
'<script src="' + ui.buildPath + '"><\/script>',
'<script src="../vendor/underscore/test/collections.js"><\/script>',
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
'<script src="../vendor/underscore/test/functions.js"><\/script>',
'<script src="../vendor/underscore/test/objects.js"><\/script>',
'<script src="../vendor/underscore/test/utility.js"><\/script>',
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
].join('\n'))
);
</script>
<script>
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
QUnit.config.autostart = false;
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': '../vendor/underscore/test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
]
},
['lodash'], function(lodash) {
if (ui.isModularize) {
window._ = lodash;
}
require([
'test/collections',
'test/arrays',
'test/functions',
'test/objects',
'test/utility',
'test/chaining'
], function() {
QUnit.start();
});
});
}());
</script>
<script type="text/html" id="template">
<%
// a comment
if (data) { data += 12345; }; %>
<li><%= data %></li>
</script>
</body>
</html>
|