summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/test/glossary.js
diff options
context:
space:
mode:
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);
});
});