diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-05-28 12:24:16 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-05-28 12:24:16 +0100 |
| commit | b2b2c35715985f624e6b696fd87140fa6056318f (patch) | |
| tree | a8015940e1d4b4bae1422af8e99277126e1df029 /test/testing.js | |
| parent | 1ce7c085668fd978f4f343b41db7f76f33145de5 (diff) | |
Avoid use of Buffer
Diffstat (limited to 'test/testing.js')
| -rw-r--r-- | test/testing.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/testing.js b/test/testing.js index cb37777..3948556 100644 --- a/test/testing.js +++ b/test/testing.js @@ -22,7 +22,7 @@ function createFakeDocxFile(files) { function exists(path) { return !!files[path]; } - + return { read: createRead(files), exists: exists @@ -41,13 +41,13 @@ function createRead(files) { if (_.isString(buffer)) { buffer = new Buffer(buffer); } - + if (!Buffer.isBuffer(buffer)) { return promises.reject(new Error("file was not a buffer")); } else if (encoding) { return promises.when(buffer.toString(encoding)); } else { - return promises.when(buffer); + return promises.when(buffer.buffer); } }); } |
