diff --git a/src/storage/noop.js b/src/storage/noop.js index fa7b92a69..4d83b23c3 100644 --- a/src/storage/noop.js +++ b/src/storage/noop.js @@ -21,7 +21,8 @@ exports = module.exports = { const assert = require('assert'), BoxError = require('../boxerror.js'), - debug = require('debug')('box:storage/noop'); + debug = require('debug')('box:storage/noop'), + fs = require('fs'); async function getProviderStatus(apiConfig) { assert.strictEqual(typeof apiConfig, 'object'); @@ -35,15 +36,18 @@ async function getAvailableSize(apiConfig) { return Number.POSITIVE_INFINITY; } -function upload(apiConfig, backupFilePath, sourceStream, callback) { +async function upload(apiConfig, backupFilePath) { assert.strictEqual(typeof apiConfig, 'object'); assert.strictEqual(typeof backupFilePath, 'string'); - assert.strictEqual(typeof sourceStream, 'object'); - assert.strictEqual(typeof callback, 'function'); - debug('upload: %s', backupFilePath); + debug(`upload: ${backupFilePath}`); - callback(null); + const uploadStream = fs.createWriteStream('/dev/null'); + + return { + stream: uploadStream, + async finish() {} + }; } async function exists(apiConfig, backupFilePath) {