-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
83 lines (67 loc) · 2.47 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript" src="minispade.js"></script>
<script type="text/javascript" src="source/ember.js"></script>
<script type="text/javascript" src="source/ember-tests.js"></script>
</head>
<body>
<h1 id="qunit-header">QUnit Test Suite</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup</div>
<script type="text/javascript">
// Handle extending prototypes
QUnit.config.urlConfig.push('extendprototypes');
window.ENV = window.ENV || {};
var extendPrototypes = location.search.match(/extendprototypes=([^&]+)/);
ENV['EXTEND_PROTOTYPES'] = !!(extendPrototypes && decodeURIComponent(extendPrototypes[1]));
// hack qunit to not suck for Ember objects
var originalTypeof = QUnit.jsDump.typeOf;
QUnit.jsDump.typeOf = function(obj) {
if (Ember && Ember.Object && Ember.Object.detectInstance(obj)) {
return "emberObject";
}
return originalTypeof.call(this, obj);
};
QUnit.jsDump.parsers.emberObject = function(obj) {
return obj.toString();
}
// Load Tests and Depenencies
var packages = location.search.match(/package=([^&]+)/),
packageName, el, idx, len, re, match, moduleName;
if (!packages) {
el = document.getElementById('qunit-header');
el.innerHTML = 'Add package=package1,package2 in the URL to test packages';
} else {
if (packages[1] === 'all') {
packages = ['ember-layout'];
} else {
packages = packages[1].split(',');
}
len = packages.length;
// There are no requires for these in the code
minispade.require('jquery-1.6.2/main');
minispade.require('ember/main');
for (idx=0; idx<len; idx++) {
packageName = packages[idx];
re = new RegExp('^'+packageName+'/([^/]+)');
minispade.require(packageName+'/main');
for (moduleName in minispade.modules) {
if (!minispade.modules.hasOwnProperty(moduleName)) { continue; }
match = moduleName.match(re);
if (match && match[1] === 'tests') {
minispade.require(moduleName);
}
}
}
}
</script>
</body>
</html>