summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test/page.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 18:08:20 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:30 +0100
commit7256573a630f9a4c1da3532a6dc0e2cdbf411411 (patch)
tree29a12e6d9b2f962366f42b0928f404327335a20c /packages/gitbook-markdown/test/page.js
parent0b3b135a3935a4f64843e673b70925d8495e271f (diff)
downloadgitbook-7256573a630f9a4c1da3532a6dc0e2cdbf411411.zip
gitbook-7256573a630f9a4c1da3532a6dc0e2cdbf411411.tar.gz
gitbook-7256573a630f9a4c1da3532a6dc0e2cdbf411411.tar.bz2
Add basic parsing of markdown using kramed
Diffstat (limited to 'packages/gitbook-markdown/test/page.js')
-rw-r--r--packages/gitbook-markdown/test/page.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js
new file mode 100644
index 0000000..158f09f
--- /dev/null
+++ b/packages/gitbook-markdown/test/page.js
@@ -0,0 +1,22 @@
+var fs = require('fs');
+var path = require('path');
+var assert = require('assert');
+
+var page = require('../').page;
+
+function loadPage (name, options) {
+ var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/' + name + '.md'), 'utf8');
+ return page(CONTENT, options).sections;
+}
+
+var LEXED = loadPage('PAGE');
+
+describe('Page parsing', function() {
+ it('should detect sections', function() {
+ assert.equal(LEXED.length, 1);
+ });
+
+ it('should gen content for normal sections', function() {
+ assert(LEXED[0].content);
+ });
+});