Don't fail if page doesn't exist

This commit is contained in:
Samy Pesse
2016-04-29 23:23:54 +02:00
parent 9acccad23a
commit faf18476b1
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -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)',
+2
View File
@@ -28,6 +28,8 @@ function parsePagesList(book) {
filepath,
Page.createForFile(file)
);
}, function() {
// file doesn't exist
});
})
.then(function() {