-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
36 lines (29 loc) · 1006 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var assert = require("assert");
var processMustache = require("./process-mustache.js");
describe("bit-docs-process-mustache", function() {
it("gets the filename correctly", function() {
processMustache("apis.mustache", null, null, null, function(docObject) {
assert.equal(docObject.name, "apis", "should remove the extension");
});
});
it("only process mustache/handlebars files", function(done) {
var testItems = [
{ name: "foo.js", expected: false },
{ name: "foo.md", expected: false },
{ name: "foo.mustache", expected: true },
{ name: "foo.handlebars", expected: true }
];
testItems.forEach(function(item) {
item.processed = false;
processMustache(item.name, null, null, null, function(docObject) {
item.processed = true;
});
});
setTimeout(function() {
testItems.forEach(function(item) {
assert.equal(item.processed, item.expected, item.name);
});
done();
}, 0);
});
});