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

Question about some tests #41

Closed
gfot2 opened this issue Jul 8, 2021 · 1 comment
Closed

Question about some tests #41

gfot2 opened this issue Jul 8, 2021 · 1 comment

Comments

@gfot2
Copy link

gfot2 commented Jul 8, 2021

Hi all, and thank you very much for your effort on delivering such great tools!

I was reading the tests, in particular:

test('main', async t => {
	const end = timeSpan();
	t.deepEqual(await pMap(sharedInput, mapper), [10, 20, 30]);
	t.true(inRange(end(), {start: 290, end: 430}));
});

test('concurrency: 1', async t => {
	const end = timeSpan();
	t.deepEqual(await pMap(sharedInput, mapper, {concurrency: 1}), [10, 20, 30]);
	t.true(inRange(end(), {start: 590, end: 760}));
});

and I would like to ask how the numbers for start and stop came out? For example, for the first test I would expect the start value to be at least 300. Are those numbers dependent on the machine workload at the time the tests are running?

@sindresorhus
Copy link
Owner

Yeah, we give it some leeway on both sides of the expected 300ms as the exact value depends on the machine and workload.

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