Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Fix samples test #1366

Merged
merged 1 commit into from Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions samples/drive/download.js
Expand Up @@ -19,6 +19,7 @@ const fs = require('fs');
const os = require('os');
const uuid = require('uuid');
const path = require('path');
const readline = require('readline');

const drive = google.drive({
version: 'v3',
Expand Down Expand Up @@ -46,8 +47,8 @@ async function runSample(fileId) {
})
.on('data', d => {
progress += d.length;
process.stdout.clearLine();
process.stdout.cursorTo(0);
readline.clearLine();
readline.cursorTo(0);
process.stdout.write(`Downloaded ${progress} bytes`);
})
.pipe(dest);
Expand Down
4 changes: 2 additions & 2 deletions samples/drive/upload.js
Expand Up @@ -38,8 +38,8 @@ async function runSample(fileName) {
// number of bytes uploaded to this point.
onUploadProgress: evt => {
const progress = (evt.bytesRead / fileSize) * 100;
process.stdout.clearLine();
process.stdout.cursorTo(0);
readline.clearLine();
readline.cursorTo(0);
process.stdout.write(`${Math.round(progress)}% complete`);
},
}
Expand Down