2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 06:16:07 +00:00

src/telegram: Populate Stream#path from TelegramBot#getFileStream()

This commit is contained in:
GochoMugo
2017-12-08 19:18:55 +03:00
parent b91409a2b6
commit b968e893d3
3 changed files with 6 additions and 2 deletions

View File

@@ -1173,6 +1173,7 @@ describe('TelegramBot', function telegramSuite() {
it('should get a file stream', function test(done) {
const fileStream = bot.getFileStream(FILE_ID);
assert.ok(fileStream instanceof stream.Readable);
assert.equal(fileStream.path, FILE_ID);
fileStream.pipe(concat(function readFile(buffer) {
buffer.equals(fs.readFileSync(FILE_PATH)); // sync :(
return done();