mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 11:26:31 +00:00
Don't fail if page doesn't exist
This commit is contained in:
@@ -26,6 +26,21 @@ describe('WebsiteGenerator', function() {
|
||||
});
|
||||
});
|
||||
|
||||
pit('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)',
|
||||
'test': {
|
||||
'page.md': 'Hello 2'
|
||||
}
|
||||
})
|
||||
.then(function(folder) {
|
||||
expect(folder).toHaveFile('index.html');
|
||||
expect(folder).not.toHaveFile('page.html');
|
||||
expect(folder).toHaveFile('test/page.html');
|
||||
});
|
||||
});
|
||||
|
||||
pit('should generate a multilingual book', function() {
|
||||
return generateMock(WebsiteGenerator, {
|
||||
'LANGS.md': '# Languages\n\n* [en](en)\n* [fr](fr)',
|
||||
|
||||
@@ -28,6 +28,8 @@ function parsePagesList(book) {
|
||||
filepath,
|
||||
Page.createForFile(file)
|
||||
);
|
||||
}, function() {
|
||||
// file doesn't exist
|
||||
});
|
||||
})
|
||||
.then(function() {
|
||||
|
||||
Reference in New Issue
Block a user