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

Not rendering properly with Listr #157

Open
vajahath opened this issue Jul 4, 2017 · 1 comment
Open

Not rendering properly with Listr #157

vajahath opened this issue Jul 4, 2017 · 1 comment

Comments

@vajahath
Copy link

vajahath commented Jul 4, 2017

Looks like node-progress not rendering properly with listr.
Consider running this following code where 2 libs coexist:

const ProgressBar = require('progress');
const Listr = require('listr');

// progress-bar
let bar = new ProgressBar(':bar', { total: 10 });
let timer = setInterval(function() {
	bar.tick();
	if (bar.complete) {
		console.log('\ncomplete\n');
		clearInterval(timer);
	}
}, 1000);

// listr
const tasks = new Listr([{
		title: 'task 1',
		task: () => {
			return new Promise((resolve) => {
				setTimeout(() => {
					resolve()
				}, 3000)
			})
		}
	},
	{
		title: 'Task 2',
		task: () => {
			return new Promise((resolve) => {
				setTimeout(() => {
					resolve()
				}, 3000)
			})
		}
	}
]);

tasks.run().catch(err => {
	console.error(err);
});

On the output progress bar blinks periodically..

@emilioriosvz
Copy link

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants