-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
35 lines (28 loc) · 913 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
var assert = require("assert");
var processLess = require("./process-less.js");
describe("bit-docs-process-less", function() {
it("gets the filename correctly", function() {
processLess("apis.less", null, null, null, function(docObject) {
assert.equal(docObject.name, "apis", "should remove the extension");
});
});
it("only process less files", function(done) {
var testItems = [
{ name: "foo.js", expected: false },
{ name: "foo.md", expected: false },
{ name: "foo.less", expected: true }
];
testItems.forEach(function(item) {
item.processed = false;
processLess(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);
});
});