summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/test/glossary.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-12-22 12:31:22 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 12:31:22 +0100
commiteb0bf31baa6cb903ba4242ae5a3866ff67aeb97c (patch)
treee2347c9e8c58dd3c2681a6028b5f8d69c40d4e04 /packages/gitbook-asciidoc/test/glossary.js
parent1c1e58b8641cac34b5f3d7c05951f507557fcb1a (diff)
downloadgitbook-eb0bf31baa6cb903ba4242ae5a3866ff67aeb97c.zip
gitbook-eb0bf31baa6cb903ba4242ae5a3866ff67aeb97c.tar.gz
gitbook-eb0bf31baa6cb903ba4242ae5a3866ff67aeb97c.tar.bz2
Import gitbook-asciidoc
Diffstat (limited to 'packages/gitbook-asciidoc/test/glossary.js')
-rwxr-xr-xpackages/gitbook-asciidoc/test/glossary.js33
1 files changed, 16 insertions, 17 deletions
diff --git a/packages/gitbook-asciidoc/test/glossary.js b/packages/gitbook-asciidoc/test/glossary.js
index f94d046..23c850a 100755
--- a/packages/gitbook-asciidoc/test/glossary.js
+++ b/packages/gitbook-asciidoc/test/glossary.js
@@ -1,29 +1,28 @@
-var fs = require('fs');
-var path = require('path');
-var assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+const expect = require('expect');
-var glossary = require('../').glossary;
+const glossary = require('../src').glossary;
-describe('Glossary parsing', function () {
- var LEXED;
+describe('Glossary parsing', () => {
+ let LEXED;
- before(function() {
- var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GLOSSARY.adoc'), 'utf8');
+ before(() => {
+ const CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GLOSSARY.adoc'), 'utf8');
LEXED = glossary(CONTENT);
});
- it('should only get heading + paragraph pairs', function() {
- assert.equal(LEXED.length, 4);
+ it('should only get heading + paragraph pairs', () => {
+ expect(LEXED.length).toBe(4);
});
- it('should output simple name/description objects', function() {
- assert.equal(true, !(LEXED.some(function(e) {
- return !Boolean(e.name && e.description);
- })));
+ it('should output simple name/description objects', () => {
+ expect(!(LEXED.some(e => !Boolean(e.name && e.description)))).toBeTruthy();
});
- it('should correctly convert it to text', function() {
- var text = glossary.toText(LEXED);
- assertObjectsEqual(glossary(text), LEXED);
+ it('should correctly convert it to text', () => {
+ const text = glossary.toText(LEXED);
+ const parsed = glossary(text);
+ expect(parsed).toEqual(LEXED);
});
});