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

Why are my test results repeated? #11

Closed
iceonion opened this issue Jun 23, 2021 · 4 comments
Closed

Why are my test results repeated? #11

iceonion opened this issue Jun 23, 2021 · 4 comments

Comments

@iceonion
Copy link

app.mjs:

import uniqueRandom from 'unique-random';

const random = uniqueRandom(1, 5);

console.log(random(), random(), random());

results:

PS D:\app\node-demo> node app.mjs
3 5 2
PS D:\app\node-demo> node app.mjs
4 1 5
PS D:\app\node-demo> node app.mjs
5 3 2
PS D:\app\node-demo> node app.mjs
2 1 2
PS D:\app\node-demo> node app.mjs
3 2 1
PS D:\app\node-demo> node app.mjs
4 1 2
PS D:\app\node-demo> node app.mjs
4 5 4
@sindresorhus
Copy link
Owner

Where exactly is it repeated?

@iceonion
Copy link
Author

Where exactly is it repeated?

PS D:\app\node-demo> node app.mjs
2 1 2
PS D:\app\node-demo> node app.mjs
4 5 4

Am I wrong?

@iceonion
Copy link
Author

Where exactly is it repeated?

Look at your source code, I understand wrong

@sindresorhus
Copy link
Owner

From the package description, the keyword is "consecutively". What you seem to want is #9.

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