Add tests for page hook

This commit is contained in:
Samy Pessé
2016-04-18 17:14:55 +02:00
parent c218f7d0e3
commit d07aa13822
5 changed files with 99 additions and 24 deletions
+8
View File
@@ -0,0 +1,8 @@
module.exports = {
hooks: {
page: function(page) {
page.sections[0].content = 'Hello (sections) ' + page.content;
return page;
}
}
};
+7
View File
@@ -0,0 +1,7 @@
{
"name": "gitbook-plugin-test-deprecated",
"version": "1.0.0",
"engines": {
"gitbook": "*"
}
}
+4 -2
View File
@@ -1,5 +1,3 @@
var should = require('should');
module.exports = {
hooks: {
'init': function() {
@@ -11,6 +9,10 @@ module.exports = {
},
'finish:before': function() {
global._hooks.push('finish:before');
},
page: function(page) {
page.content = 'Hello ' + page.content;
return page;
}
}
};