summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/plugins.js22
-rw-r--r--test/plugins/resources/index.js7
2 files changed, 24 insertions, 5 deletions
diff --git a/test/plugins.js b/test/plugins.js
index 2351537..c7d1f90 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -48,19 +48,33 @@ describe('Plugins', function () {
assert(plugin.isValid());
});
- it('should return a valid list of resources', function(done) {
+ it('should return a valid list of resources (website)', function(done) {
qdone(
- plugin.getResources()
+ plugin.getResources("website")
.then(function(resources) {
assert.equal(resources["js"].length, 1);
}),
done);
});
- it('should extend books plugins', function() {
- var resources = books[0].plugins.resources;
+ it('should return a valid list of resources (ebook)', function(done) {
+ qdone(
+ plugin.getResources("ebook")
+ .then(function(resources) {
+ assert.equal(resources["css"].length, 1);
+ }),
+ done);
+ });
+
+ it('should extend books plugins (website)', function() {
+ var resources = books[0].plugins.resources("website");
assert.equal(resources["js"].length, 1);
});
+
+ it('should extend books plugins (ebook)', function() {
+ var resources = books[0].plugins.resources("ebook");
+ assert.equal(resources["css"].length, 1);
+ });
});
describe('filters', function() {
diff --git a/test/plugins/resources/index.js b/test/plugins/resources/index.js
index 68b3c39..d98d6f0 100644
--- a/test/plugins/resources/index.js
+++ b/test/plugins/resources/index.js
@@ -1,7 +1,12 @@
module.exports = {
- book: {
+ website: {
js: [
"https://cdn.mathjax.org/mathjax/2.4-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
]
+ },
+ ebook: {
+ css: [
+ "test"
+ ]
}
};