forked from theintern/intern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.html
50 lines (47 loc) · 1.43 KB
/
client.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Browser test runner</title>
<script src="node_modules/dojo/loader.js"></script>
<script>
(function () {
var internPath = location.pathname.replace(/\/+[^\/]*$/, '/');
var initialBaseUrl = (function () {
var result = /[?&]initialBaseUrl=([^&]*)/.exec(location.search);
if (result) {
var baseUrl = decodeURIComponent(result[1]);
if (/^(?:\w+:)?\/\//.test(baseUrl)) {
throw new Error('Cross-origin loading of test modules is not allowed for security reasons');
}
return baseUrl;
}
else {
// For users running client.html directly, assume that the initial base URL is two levels up
// (the parent directory of node_modules/intern); this is most common.
// Users that need something special can provide a different `initialBaseUrl`.
return internPath.replace(/(?:\/+[^\/]*){2}\/?$/, '/');
}
})();
var internConfig = this.__internConfig = {
baseUrl: initialBaseUrl,
packages: [
{ name: 'intern', location: internPath }
],
map: {
intern: {
dojo: 'intern/node_modules/dojo',
chai: 'intern/node_modules/chai/chai',
diff: 'intern/node_modules/diff/diff'
},
'*': {
'intern/dojo': 'intern/node_modules/dojo'
}
}
};
require(internConfig, [ 'intern/client' ]);
})();
</script>
</head>
<body></body>
</html>