aboutsummaryrefslogtreecommitdiff
path: root/test/docx/files.tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/docx/files.tests.js')
-rw-r--r--test/docx/files.tests.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/docx/files.tests.js b/test/docx/files.tests.js
index 5ddda4a..91de108 100644
--- a/test/docx/files.tests.js
+++ b/test/docx/files.tests.js
@@ -1,16 +1,13 @@
var path = require("path");
-var fs = require("fs");
var assert = require("assert");
-var promises = require("../../lib/promises");
var Files = require("../../lib/docx/files").Files;
var uriToPath = require("../../lib/docx/files").uriToPath;
+var fs = require("../../lib/fs");
var testing = require("../testing");
var test = require("../test")(module);
-var readFile = promises.promisify(fs.readFile.bind(fs));
-
test("Files", {
"when external file access is disabled then reading file raises error": function() {
@@ -24,7 +21,7 @@ test("Files", {
var filePath = path.resolve(testing.testPath("tiny-picture.png"));
var files = new Files({externalFileAccess: true});
return files.read("file:///" + filePath.replace(/^\//, ""), "base64").then(function(contents) {
- return readFile(filePath, "base64").then(function(expectedContents) {
+ return fs.readFile(filePath, "base64").then(function(expectedContents) {
assert.deepEqual(contents, expectedContents);
});
});
@@ -37,7 +34,7 @@ test("Files", {
relativeToFile: testing.testPath("./document.docx")
});
return files.read("tiny-picture.png", "base64").then(function(contents) {
- return readFile(filePath, "base64").then(function(expectedContents) {
+ return fs.readFile(filePath, "base64").then(function(expectedContents) {
assert.deepEqual(contents, expectedContents);
});
});