-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathspecs.html
61 lines (56 loc) · 1.95 KB
/
specs.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
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-1" content="text/html" http-equiv="Content-Type"/>
<title>Speclj Specs</title>
<!--<script src="../js/es5-shim.js" type="text/javascript"></script>-->
<script src="../target/cljs/goog/base.js" type="text/javascript"></script>
<script src="../target/specs.js" type="text/javascript"></script>
<script type="text/javascript">
String.prototype.endsWith = function (suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1
}
// Load all the specs
for (let k in goog.debugLoader_.dependencies_) {
let dep = goog.debugLoader_.dependencies_[k]
dep.provides
.filter(ns => ns.endsWith("_spec"))
.forEach(goog.require)
}
runSpecsConfigured = function (color, reporter) {
speclj.run.standard.arm()
return speclj.run.standard.run_specs(
"color", color,
"reporters", [reporter]
)
}
runSpecs = function () {
return runSpecsConfigured(false, "documentation")
}
runSpecsFiltered = function (affectedSpecs) {
if (affectedSpecs != null) {
console.log("Only running affected specs:")
var runner = speclj.config.active_runner()
speclj.running.filter_descriptions(runner, affectedSpecs)
speclj.running.get_descriptions(runner)
.forEach((description) =>
console.log(" ", description.ns))
}
return runSpecsConfigured(true, "documentation")
}
</script>
</head>
<body>
<h3 style="margin: 1em">Speclj CLJS Specs</h3>
<p style="margin: 1em; width: 400px;">
Typically these specs are run using a headless browser driven by a script.
But you can run them here if you like.
That is, assuming all the cljs has been compiled in development.
<br/>
Open up the browser console:
</p>
<pre style="margin: 1em; padding: 1em; width: 400px; border: 1px dotted slategray; background-color: lightgray;">
runSpecs()
</pre>
</body>
</html>