From 846b60254b598f4f2958b56ca6eb26b4b2b38e91 Mon Sep 17 00:00:00 2001 From: Markus Felten Date: Sat, 29 Jul 2017 21:58:24 +0200 Subject: [PATCH] feat: add context arg to url handler methods --- src/sftp-scheme.js | 3 ++- tests/sftp-test.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sftp-scheme.js b/src/sftp-scheme.js index b3446b6..9f6d192 100644 --- a/src/sftp-scheme.js +++ b/src/sftp-scheme.js @@ -38,12 +38,13 @@ export default class SFTPScheme extends URLScheme { /** * Creates a readable stream for the content of th file associated to a given file URL + * @param context {Context} execution context * @param url {URL} of the a file * @param [options] {object|string} passed as options to fs.createReadStream() * @returns {Promise} * @fulfil {ReadableStream} - of the file content */ - async get(url, options) { + async get(context, url, options) { const sftp = new Client(); const co = { diff --git a/tests/sftp-test.js b/tests/sftp-test.js index 5bb1359..e38e1ca 100644 --- a/tests/sftp-test.js +++ b/tests/sftp-test.js @@ -33,12 +33,14 @@ test.before('start SFTP server', async t => { }); test('get', async t => { + const context = undefined; const scheme = new SFTPScheme({ privateKey: fs.readFileSync( path.join(__dirname, '..', 'tests', 'fixtures', 'identity.key') ) }); const content = await scheme.get( + context, new URL(`sftp://${USER}:${PASSWORD}@localhost:${PORT}${FILE}`) );