diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-18 17:14:55 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-18 17:14:55 +0200 |
commit | d07aa13822230ee5086bafcb9ea16cb8447fb562 (patch) | |
tree | 14259c6254d20919a9964f96f5e90133af1cc689 /test/node_modules | |
parent | c218f7d0e30d8088ebd09951691647ffed7fe91d (diff) | |
download | gitbook-d07aa13822230ee5086bafcb9ea16cb8447fb562.zip gitbook-d07aa13822230ee5086bafcb9ea16cb8447fb562.tar.gz gitbook-d07aa13822230ee5086bafcb9ea16cb8447fb562.tar.bz2 |
Add tests for page hook
Diffstat (limited to 'test/node_modules')
3 files changed, 19 insertions, 2 deletions
diff --git a/test/node_modules/gitbook-plugin-test-deprecated/index.js b/test/node_modules/gitbook-plugin-test-deprecated/index.js new file mode 100644 index 0000000..2a77ce3 --- /dev/null +++ b/test/node_modules/gitbook-plugin-test-deprecated/index.js @@ -0,0 +1,8 @@ +module.exports = { + hooks: { + page: function(page) { + page.sections[0].content = 'Hello (sections) ' + page.content; + return page; + } + } +}; diff --git a/test/node_modules/gitbook-plugin-test-deprecated/package.json b/test/node_modules/gitbook-plugin-test-deprecated/package.json new file mode 100644 index 0000000..9da523c --- /dev/null +++ b/test/node_modules/gitbook-plugin-test-deprecated/package.json @@ -0,0 +1,7 @@ +{ + "name": "gitbook-plugin-test-deprecated", + "version": "1.0.0", + "engines": { + "gitbook": "*" + } +}
\ No newline at end of file diff --git a/test/node_modules/gitbook-plugin-test-hooks/index.js b/test/node_modules/gitbook-plugin-test-hooks/index.js index c0666ca..cd9d1b0 100644 --- a/test/node_modules/gitbook-plugin-test-hooks/index.js +++ b/test/node_modules/gitbook-plugin-test-hooks/index.js @@ -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; } } }; |