Add tests for context of filters

This commit is contained in:
Samy Pessé
2016-02-22 15:34:35 +01:00
parent 642ba72a1d
commit 6653307fda
5 changed files with 58 additions and 9 deletions
+21
View File
@@ -0,0 +1,21 @@
var should = require('should');
module.exports = {
filters: {
// Simple test
hello: function(s) {
return 'Hello ' + s + '!';
},
// Test using the conetxt "this"
testContext: function(s) {
this.should.have.property('config');
this.should.have.property('log');
this.should.have.property('options');
this.should.have.property('resolve').which.is.a.function;
this.should.have.property('book').which.equal(this);
return 'Hello ' + s + '!';
}
}
};
+7
View File
@@ -0,0 +1,7 @@
{
"name": "gitbook-plugin-test-filters",
"version": "1.0.0",
"engines": {
"gitbook": "*"
}
}