summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-markdown/test')
-rw-r--r--packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md5
-rw-r--r--packages/gitbook-markdown/test/summary.js5
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md b/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md
new file mode 100644
index 0000000..3ffacfd
--- /dev/null
+++ b/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md
@@ -0,0 +1,5 @@
+# Summary
+
+* [Chapter 1](chapter-1/README.md)
+*  
+
diff --git a/packages/gitbook-markdown/test/summary.js b/packages/gitbook-markdown/test/summary.js
index 6854bc0..98cd57f 100644
--- a/packages/gitbook-markdown/test/summary.js
+++ b/packages/gitbook-markdown/test/summary.js
@@ -51,6 +51,11 @@ describe('Summary parsing', function () {
assert.equal(l.chapters.length, 5);
});
+ it('should allow ignore empty entries', function() {
+ var l = lex('SUMMARY_EMPTY.md');
+ assert.equal(l.chapters.length, 1);
+ });
+
it('should correctly convert it to text', function() {
var text = summary.toText(LEXED);
assertObjectsEqual(summary(text), LEXED);