[@types/ssh2-sftp-client] multi-line "definitions by"; added new tests

This commit is contained in:
Michael Pertl
2018-11-29 16:23:22 +01:00
parent 8046ef23ae
commit c74a7e8088
2 changed files with 11 additions and 1 deletions
+4 -1
View File
@@ -1,6 +1,9 @@
// Type definitions for ssh2-sftp-client 2.4
// Project: https://www.npmjs.com/package/ssh2-sftp-client
// Definitions by: igrayson <https://github.com/igrayson>, Ascari Andrea <https://github.com/ascariandrea>, Kartik Malik <https://github.com/kartik2406>, Michael Pertl <https://github.com/viamuli>
// Definitions by: igrayson <https://github.com/igrayson>
// Ascari Andrea <https://github.com/ascariandrea>
// Kartik Malik <https://github.com/kartik2406>
// Michael Pertl <https://github.com/viamuli>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as ssh2 from 'ssh2';
@@ -1,5 +1,6 @@
import Client = require('ssh2-sftp-client');
import * as fs from 'fs';
const client = new Client();
client.connect({
@@ -11,6 +12,10 @@ client.connect({
client.list('/remote/path').then(() => null);
client.exists('/remote/path').then(() => null);
client.stat('/remote/path').then(() => null);
client.get('/remote/path').then(stream => stream.read(0));
client.get('/remote/path', true, 'utf8').then(stream => stream.read(0));
client.get('/remote/path', true, null).then(stream => stream.read(0));
@@ -30,6 +35,8 @@ client.delete('remote/path').then(() => null);
client.rename('/remote/from', '/remote/to').then(() => null);
client.chmod('/remote/path', 777).then(() => null);
client.end().then(() => null);
client.on('event', () => null);