Skip to content

Commit 4d30717

Browse files
committed
Merge pull request #132 from aaronsofaly/master
Added missing test suite
2 parents 7acb0bb + 0f83adb commit 4d30717

File tree

15 files changed

+12797
-8619
lines changed

15 files changed

+12797
-8619
lines changed

_includes/apiSidebar.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<nav id="api" class="sidebar sticky">
2+
<a href="{{ site.github.url }}/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
3+
Introduction
4+
</a>
5+
<a href="{{ site.github.url }}/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
6+
Expect / Should
7+
</a>
8+
<a href="{{ site.github.url }}/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
9+
Assert
10+
</a>
11+
<a href="{{ site.github.url }}/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
12+
Plugin Utilities
13+
</a>
14+
<a href="{{ site.github.url }}/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
15+
Online Test Suite
16+
</a>
17+
{% if page.api_namespace %}
18+
<div class="list box-wrap antiscroll-wrap" style="height: 338px;">
19+
<div class="box">
20+
<div class="antiscroll-inner" style="height: 338px; width: 225px;">
21+
<div class="box-inner">
22+
{% for method in site.data.chai %}
23+
{% assign render = false %}
24+
{% assign name = false %}
25+
{% for tag in method.tags %}
26+
{% if tag.type == "namespace" and tag.string == page.api_namespace %}
27+
{% assign render = true %}
28+
{% endif %}
29+
{% if tag.type == "name" %}
30+
{% capture name %}{{ tag.string }}{% endcapture %}
31+
{% endif %}
32+
{% endfor %}
33+
{% if render %}
34+
<a href="#method_{{ name | slugify }}" class="scroll item">{{ name }}</a>
35+
{% endif %}
36+
{% endfor %}
37+
</div>
38+
</div>
39+
</div>
40+
</div>
41+
{% endif %}
42+
</nav>

_includes/footer.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ <h3 class="fancy">
3434
</ul>
3535
</div>
3636
</section>
37-
<script src="/chai.js" type="text/javascript"></script>
3837
</footer>

_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<script src="{{site.github.url}}/js/jquery-mousewheel.js"></script>
1515
<script src="{{site.github.url}}/js/antiscroll.js"></script>
1616
<script src="{{site.github.url}}/js/main.js"></script>
17+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/chai.js"></script>
1718

1819
<link rel='stylesheet', href="{{site.github.url}}/css/antiscroll.css" type="text/css" media="all">
1920
<link rel='stylesheet', href="{{site.github.url}}/css/main.css" type="text/css" media="all">

_layouts/api.html

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,7 @@
22
layout: default
33
bodyClass: api
44
---
5-
<nav id="api" class="sidebar sticky">
6-
<a href="{{ site.github.url }}/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
7-
Introduction
8-
</a>
9-
<a href="{{ site.github.url }}/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
10-
Expect / Should
11-
</a>
12-
<a href="{{ site.github.url }}/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
13-
Assert
14-
</a>
15-
<a href="{{ site.github.url }}/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
16-
Plugin Utilities
17-
</a>
18-
<a href="{{ site.github.url }}/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
19-
Online Test Suite
20-
</a>
21-
{% if page.api_namespace %}
22-
<div class="list box-wrap antiscroll-wrap" style="height: 338px;">
23-
<div class="box">
24-
<div class="antiscroll-inner" style="height: 338px; width: 225px;">
25-
<div class="box-inner">
26-
{% for method in site.data.chai %}
27-
{% assign render = false %}
28-
{% assign name = false %}
29-
{% for tag in method.tags %}
30-
{% if tag.type == "namespace" and tag.string == page.api_namespace %}
31-
{% assign render = true %}
32-
{% endif %}
33-
{% if tag.type == "name" %}
34-
{% capture name %}{{ tag.string }}{% endcapture %}
35-
{% endif %}
36-
{% endfor %}
37-
{% if render %}
38-
<a href="#method_{{ name | slugify }}" class="scroll item">{{ name }}</a>
39-
{% endif %}
40-
{% endfor %}
41-
</div>
42-
</div>
43-
</div>
44-
</div>
45-
{% endif %}
46-
</nav>
5+
{% include apiSidebar.html %}
476
<div class="documentation">
487
<div class="wrap">
498
<div class="rendered">

_layouts/test.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
layout: default
3+
bodyClass: tests
4+
---
5+
{% include apiSidebar.html %}
6+
<div class="documentation">
7+
<div class="wrap">
8+
<div class="rendered">
9+
<article>
10+
{{ content }}
11+
</article>
12+
</div>
13+
<div id="mocha"></div>
14+
</div>
15+
</div>
16+
<script src="{{ site.github.url }}/js/mocha.js"></script>
17+
<script>
18+
mocha.setup('bdd');
19+
20+
err = function (fn, msg) {
21+
try {
22+
fn();
23+
throw new chai.AssertionError({ message: 'Expected an error' });
24+
} catch (err) {
25+
if ('string' === typeof msg) {
26+
chai.expect(err.message).to.equal(msg);
27+
} else {
28+
chai.expect(err.message).to.match(msg);
29+
}
30+
}
31+
};
32+
</script>
33+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/assert.js"></script>
34+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/configuration.js"></script>
35+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/expect.js"></script>
36+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/globalShould.js"></script>
37+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/plugins.js"></script>
38+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/should.js"></script>
39+
<script src="https://cdn.rawgit.com/chaijs/chai/{{ site.data.releases[0].tag_name }}/test/utilities.js"></script>
40+
<script>
41+
mocha.run();
42+
</script>

api/test.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Online Test Suite
3-
template: tests
3+
layout: test
44
weight: 35
55
permalink: /api/test/
66
---
@@ -11,5 +11,3 @@ This is the test suite that we use to test Chai during development. Use it to co
1111
that Chai will function correctly in your browser environment (`should` does
1212
not work in IE9). These tests are powered by the awesome [Mocha](http://visionmedia.github.com/mocha/)
1313
test framework.
14-
15-
***The test suite is currently missing, as discussed [on this issue](https://github.com/chaijs/chai-docs/issues/122). We welcome any help in bringing it back!***

0 commit comments

Comments
 (0)