summaryrefslogtreecommitdiffstats
path: root/lib/output
diff options
context:
space:
mode:
Diffstat (limited to 'lib/output')
-rw-r--r--lib/output/__tests__/ebook.js2
-rw-r--r--lib/output/__tests__/json.js4
-rw-r--r--lib/output/__tests__/website.js20
-rw-r--r--lib/output/modifiers/__tests__/addHeadingId.js9
-rw-r--r--lib/output/modifiers/__tests__/annotateText.js5
-rw-r--r--lib/output/modifiers/__tests__/fetchRemoteImages.js4
-rw-r--r--lib/output/modifiers/__tests__/highlightCode.js13
-rw-r--r--lib/output/modifiers/__tests__/inlinePng.js2
-rw-r--r--lib/output/modifiers/__tests__/resolveLinks.js13
-rw-r--r--lib/output/modifiers/__tests__/svgToImg.js2
-rw-r--r--lib/output/modifiers/__tests__/svgToPng.js7
11 files changed, 35 insertions, 46 deletions
diff --git a/lib/output/__tests__/ebook.js b/lib/output/__tests__/ebook.js
index dabf360..bcac990 100644
--- a/lib/output/__tests__/ebook.js
+++ b/lib/output/__tests__/ebook.js
@@ -3,7 +3,7 @@ var EbookGenerator = require('../ebook');
describe('EbookGenerator', function() {
- pit('should generate a SUMMARY.html', function() {
+ it('should generate a SUMMARY.html', function() {
return generateMock(EbookGenerator, {
'README.md': 'Hello World'
})
diff --git a/lib/output/__tests__/json.js b/lib/output/__tests__/json.js
index 94a0362..46ab42f 100644
--- a/lib/output/__tests__/json.js
+++ b/lib/output/__tests__/json.js
@@ -3,7 +3,7 @@ var JSONGenerator = require('../json');
describe('JSONGenerator', function() {
- pit('should generate a README.json', function() {
+ it('should generate a README.json', function() {
return generateMock(JSONGenerator, {
'README.md': 'Hello World'
})
@@ -12,7 +12,7 @@ describe('JSONGenerator', function() {
});
});
- pit('should generate a json file for each articles', function() {
+ it('should generate a json file for each articles', function() {
return generateMock(JSONGenerator, {
'README.md': 'Hello World',
'SUMMARY.md': '# Summary\n\n* [Page](test/page.md)',
diff --git a/lib/output/__tests__/website.js b/lib/output/__tests__/website.js
index d9fe123..554c56c 100644
--- a/lib/output/__tests__/website.js
+++ b/lib/output/__tests__/website.js
@@ -3,7 +3,7 @@ var WebsiteGenerator = require('../website');
describe('WebsiteGenerator', function() {
- pit('should generate an index.html', function() {
+ it('should generate an index.html', function() {
return generateMock(WebsiteGenerator, {
'README.md': 'Hello World'
})
@@ -12,7 +12,7 @@ describe('WebsiteGenerator', function() {
});
});
- pit('should copy asset files', function() {
+ it('should copy asset files', function() {
return generateMock(WebsiteGenerator, {
'README.md': 'Hello World',
'myJsFile.js': 'var a = "test";',
@@ -27,7 +27,7 @@ describe('WebsiteGenerator', function() {
});
});
- pit('should generate an index.html for AsciiDoc', function() {
+ it('should generate an index.html for AsciiDoc', function() {
return generateMock(WebsiteGenerator, {
'README.adoc': 'Hello World'
})
@@ -36,7 +36,7 @@ describe('WebsiteGenerator', function() {
});
});
- pit('should generate an HTML file for each articles', function() {
+ it('should generate an HTML file for each articles', function() {
return generateMock(WebsiteGenerator, {
'README.md': 'Hello World',
'SUMMARY.md': '# Summary\n\n* [Page](test/page.md)',
@@ -50,7 +50,7 @@ describe('WebsiteGenerator', function() {
});
});
- pit('should not generate file if entry file doesn\'t exist', function() {
+ it('should not generate file if entry file doesn\'t exist', function() {
return generateMock(WebsiteGenerator, {
'README.md': 'Hello World',
'SUMMARY.md': '# Summary\n\n* [Page 1](page.md)\n* [Page 2](test/page.md)',
@@ -60,12 +60,12 @@ describe('WebsiteGenerator', function() {
})
.then(function(folder) {
expect(folder).toHaveFile('index.html');
- expect(folder).not.toHaveFile('page.html');
+ expect(folder).toNotHaveFile('page.html');
expect(folder).toHaveFile('test/page.html');
});
});
- pit('should generate a multilingual book', function() {
+ it('should generate a multilingual book', function() {
return generateMock(WebsiteGenerator, {
'LANGS.md': '# Languages\n\n* [en](en)\n* [fr](fr)',
'en': {
@@ -81,12 +81,12 @@ describe('WebsiteGenerator', function() {
expect(folder).toHaveFile('fr/index.html');
// Should not copy languages as assets
- expect(folder).not.toHaveFile('en/README.md');
- expect(folder).not.toHaveFile('fr/README.md');
+ expect(folder).toNotHaveFile('en/README.md');
+ expect(folder).toNotHaveFile('fr/README.md');
// Should copy assets only once
expect(folder).toHaveFile('gitbook/style.css');
- expect(folder).not.toHaveFile('en/gitbook/style.css');
+ expect(folder).toNotHaveFile('en/gitbook/style.css');
expect(folder).toHaveFile('index.html');
});
diff --git a/lib/output/modifiers/__tests__/addHeadingId.js b/lib/output/modifiers/__tests__/addHeadingId.js
index 7277440..a3b1d81 100644
--- a/lib/output/modifiers/__tests__/addHeadingId.js
+++ b/lib/output/modifiers/__tests__/addHeadingId.js
@@ -1,11 +1,8 @@
-jest.autoMockOff();
-
var cheerio = require('cheerio');
+var addHeadingId = require('../addHeadingId');
describe('addHeadingId', function() {
- var addHeadingId = require('../addHeadingId');
-
- pit('should add an ID if none', function() {
+ it('should add an ID if none', function() {
var $ = cheerio.load('<h1>Hello World</h1><h2>Cool !!</h2>');
return addHeadingId($)
@@ -15,7 +12,7 @@ describe('addHeadingId', function() {
});
});
- pit('should not change existing IDs', function() {
+ it('should not change existing IDs', function() {
var $ = cheerio.load('<h1 id="awesome">Hello World</h1>');
return addHeadingId($)
diff --git a/lib/output/modifiers/__tests__/annotateText.js b/lib/output/modifiers/__tests__/annotateText.js
index 15d4c30..40b1e6c 100644
--- a/lib/output/modifiers/__tests__/annotateText.js
+++ b/lib/output/modifiers/__tests__/annotateText.js
@@ -1,12 +1,9 @@
-jest.autoMockOff();
-
var Immutable = require('immutable');
var cheerio = require('cheerio');
var GlossaryEntry = require('../../../models/glossaryEntry');
+var annotateText = require('../annotateText');
describe('annotateText', function() {
- var annotateText = require('../annotateText');
-
var entries = Immutable.List([
GlossaryEntry({ name: 'Word' }),
GlossaryEntry({ name: 'Multiple Words' })
diff --git a/lib/output/modifiers/__tests__/fetchRemoteImages.js b/lib/output/modifiers/__tests__/fetchRemoteImages.js
index f5610a2..bc1704d 100644
--- a/lib/output/modifiers/__tests__/fetchRemoteImages.js
+++ b/lib/output/modifiers/__tests__/fetchRemoteImages.js
@@ -12,7 +12,7 @@ describe('fetchRemoteImages', function() {
dir = tmp.dirSync();
});
- pit('should download image file', function() {
+ it('should download image file', function() {
var $ = cheerio.load('<img src="' + URL + '" />');
return fetchRemoteImages(dir.name, 'index.html', $)
@@ -24,7 +24,7 @@ describe('fetchRemoteImages', function() {
});
});
- pit('should download image file and replace with relative path', function() {
+ it('should download image file and replace with relative path', function() {
var $ = cheerio.load('<img src="' + URL + '" />');
return fetchRemoteImages(dir.name, 'test/index.html', $)
diff --git a/lib/output/modifiers/__tests__/highlightCode.js b/lib/output/modifiers/__tests__/highlightCode.js
index bd7d422..75d9902 100644
--- a/lib/output/modifiers/__tests__/highlightCode.js
+++ b/lib/output/modifiers/__tests__/highlightCode.js
@@ -1,11 +1,8 @@
-jest.autoMockOff();
-
var cheerio = require('cheerio');
var Promise = require('../../../utils/promise');
+var highlightCode = require('../highlightCode');
describe('highlightCode', function() {
- var highlightCode = require('../highlightCode');
-
function doHighlight(lang, code) {
return {
text: '' + (lang || '') + '$' + code
@@ -19,7 +16,7 @@ describe('highlightCode', function() {
});
}
- pit('should call it for normal code element', function() {
+ it('should call it for normal code element', function() {
var $ = cheerio.load('<p>This is a <code>test</code></p>');
return highlightCode(doHighlight, $)
@@ -29,7 +26,7 @@ describe('highlightCode', function() {
});
});
- pit('should call it for markdown code block', function() {
+ it('should call it for markdown code block', function() {
var $ = cheerio.load('<pre><code class="lang-js">test</code></pre>');
return highlightCode(doHighlight, $)
@@ -39,7 +36,7 @@ describe('highlightCode', function() {
});
});
- pit('should call it for asciidoc code block', function() {
+ it('should call it for asciidoc code block', function() {
var $ = cheerio.load('<pre><code class="language-python">test</code></pre>');
return highlightCode(doHighlight, $)
@@ -49,7 +46,7 @@ describe('highlightCode', function() {
});
});
- pit('should accept async highlighter', function() {
+ it('should accept async highlighter', function() {
var $ = cheerio.load('<pre><code class="language-python">test</code></pre>');
return highlightCode(doHighlightAsync, $)
diff --git a/lib/output/modifiers/__tests__/inlinePng.js b/lib/output/modifiers/__tests__/inlinePng.js
index fb094f7..0073cff 100644
--- a/lib/output/modifiers/__tests__/inlinePng.js
+++ b/lib/output/modifiers/__tests__/inlinePng.js
@@ -9,7 +9,7 @@ describe('inlinePng', function() {
dir = tmp.dirSync();
});
- pit('should write an inline PNG using data URI as a file', function() {
+ it('should write an inline PNG using data URI as a file', function() {
var $ = cheerio.load('<img alt="GitBook Logo 20x20" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUEAYAAADdGcFOAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAAF+klEQVRIDY3Wf5CVVR3H8c9z791fyI9dQwdQ4TTI7wEWnQZZAa/mJE4Z0OaKUuN1KoaykZxUGGHay+iIVFMoEYrUPhDCKEKW2ChT8dA0RCSxWi6EW3sYYpcfxq5C+4O9957O+7m7O/qHQ9/XzH1+nHuec57z8wkWTsKw0y6N/LxXN6KzTnEUHi8eP/l3YStSU/MdsYvBbGh8six2YXcbcgc++QkfTQkWz/81KtqDA0hlUoWnsX+5u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oED0HqeQiyJYcwkNGWnoNv6s9C1p1Bf/389VYoCjohW7UfMms3wXdpBv7+FEiPLIHs4DIMNERUNhbSpY3wk6QOsqlCDVx2xCrInMpBmfNPQOnzKxBkkrugdOl9GKigSZZCUWIm/GqwDtLUI5D+WAOlb9wKP0YvQLbjZSjsaYaL/n0/FA3fDtnCGihK5UYjCK+ZDr+TDIKLdm2Fs1UOzo76F5wO74XSZj0S6d7RCMLkCshcXALZxaWQRjXDZQ62oRAdCeG/Ju5HELX2QFH3C0hkRy6GovyfwF58AoVbguOxyB2H7/I34Gf11yANnQSp7Vr4MbQH0vg7kbNNp5AM3UrIVDchnz56B1Jm573wW9gZSFVPwO/hefg5FsIvN09CchtQCIOFw/F5U8ii3CZn4cqo7C8YlXEPYkx9cacZl00+iwnprrtwVdj1Q/gXmAs/pu6LZc9XQOGgSvh19n2cDZN341g2EcfxTEGwH/RewqlMsUfbbWIGLjUG+j/j9nokD1beiOvLS5dhjr30Gu6ZnivgdtM/6VJvY1+6pBHbH+h9CX84vfMxNJtisYVFlys+WNCIZJNmIsjohlhNSQC3f8R55H+y/hjkN8GPR9ndCLJxT4/3n0Px51ay8XQnNrYfDJHf//Fc0oMrEZSeeQGJ7+Z+gKCgLbHNWgXnB9FlYt5JaN38JIINC95EakjtAqQeuUx21c5B6tEFf0fSfbEFQf28Z6D6y+X/H0jf40QQJhYwAAAAAElFTkSuQmCC"/>');
return inlinePng(dir.name, 'index.html', $)
diff --git a/lib/output/modifiers/__tests__/resolveLinks.js b/lib/output/modifiers/__tests__/resolveLinks.js
index 3d50d80..9b7621b 100644
--- a/lib/output/modifiers/__tests__/resolveLinks.js
+++ b/lib/output/modifiers/__tests__/resolveLinks.js
@@ -1,11 +1,8 @@
-jest.autoMockOff();
-
var path = require('path');
var cheerio = require('cheerio');
+var resolveLinks = require('../resolveLinks');
describe('resolveLinks', function() {
- var resolveLinks = require('../resolveLinks');
-
function resolveFileBasic(href) {
return href;
}
@@ -21,7 +18,7 @@ describe('resolveLinks', function() {
describe('Absolute path', function() {
var TEST = '<p>This is a <a href="/test/cool.md"></a></p>';
- pit('should resolve path starting by "/" in root directory', function() {
+ it('should resolve path starting by "/" in root directory', function() {
var $ = cheerio.load(TEST);
return resolveLinks('hello.md', resolveFileBasic, $)
@@ -31,7 +28,7 @@ describe('resolveLinks', function() {
});
});
- pit('should resolve path starting by "/" in child directory', function() {
+ it('should resolve path starting by "/" in child directory', function() {
var $ = cheerio.load(TEST);
return resolveLinks('afolder/hello.md', resolveFileBasic, $)
@@ -45,7 +42,7 @@ describe('resolveLinks', function() {
describe('Custom Resolver', function() {
var TEST = '<p>This is a <a href="/test/cool.md"></a> <a href="afile.png"></a></p>';
- pit('should resolve path correctly for absolute path', function() {
+ it('should resolve path correctly for absolute path', function() {
var $ = cheerio.load(TEST);
return resolveLinks('hello.md', resolveFileCustom, $)
@@ -55,7 +52,7 @@ describe('resolveLinks', function() {
});
});
- pit('should resolve path correctly for absolute path (2)', function() {
+ it('should resolve path correctly for absolute path (2)', function() {
var $ = cheerio.load(TEST);
return resolveLinks('afodler/hello.md', resolveFileCustom, $)
diff --git a/lib/output/modifiers/__tests__/svgToImg.js b/lib/output/modifiers/__tests__/svgToImg.js
index 793395e..5fe9796 100644
--- a/lib/output/modifiers/__tests__/svgToImg.js
+++ b/lib/output/modifiers/__tests__/svgToImg.js
@@ -9,7 +9,7 @@ describe('svgToImg', function() {
dir = tmp.dirSync();
});
- pit('should write svg as a file', function() {
+ it('should write svg as a file', function() {
var $ = cheerio.load('<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" version="1.1"><rect width="200" height="100" stroke="black" stroke-width="6" fill="green"/></svg>');
return svgToImg(dir.name, 'index.html', $)
diff --git a/lib/output/modifiers/__tests__/svgToPng.js b/lib/output/modifiers/__tests__/svgToPng.js
index 163d72e..dbb3502 100644
--- a/lib/output/modifiers/__tests__/svgToPng.js
+++ b/lib/output/modifiers/__tests__/svgToPng.js
@@ -2,16 +2,17 @@ var cheerio = require('cheerio');
var tmp = require('tmp');
var path = require('path');
+var svgToImg = require('../svgToImg');
+var svgToPng = require('../svgToPng');
+
describe('svgToPng', function() {
var dir;
- var svgToImg = require('../svgToImg');
- var svgToPng = require('../svgToPng');
beforeEach(function() {
dir = tmp.dirSync();
});
- pit('should write svg as png file', function() {
+ it('should write svg as png file', function() {
var $ = cheerio.load('<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" version="1.1"><rect width="200" height="100" stroke="black" stroke-width="6" fill="green"/></svg>');
var fileName = 'index.html';