blob: f2cf55a5f0c82cdfa7df4dfca95f6b7859b82ac2 (
plain)
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
|
var path = require("path");
var fs = require("fs");
var q = require("q");
exports.test = test;
exports.testData = testData;
exports.createFakeDocxFile = createFakeDocxFile;
function test(name, func) {
it(name, function(done) {
var result = func();
q.when(result).then(function() {
done()
}).done();
});
}
function testData(testDataPath) {
var fullPath = path.join(__dirname, "test-data", testDataPath);
return q.nfcall(fs.readFile, fullPath, "utf-8");
}
function createFakeDocxFile(files) {
function read(path) {
return files[path];
}
return {
read: read
};
}
|