Open hellboy81 opened 8 years ago
Why would you stub a method that generates a UUIDv4 with a method that generates a UUIDv4 when you could just use the method itself?
OK, in which cases I SHOULD do it?
I should test if -
char has been removed from random uuid:
// Code in SUT
uuid.v4().replace(/-/g, '')
As I mentioned I should stub uuid.v4()
with string constant only?
Usage of chance.guid
is in this case unnecessary.
I'm sorry, but I don't think I understand the question :( Maybe someone else can help.
Are you comparing whether you should use uuid.v4()
and chance.guid()
?
They provide the some kind of output and it's up to you to decide which one to use.
is chance.guid() guaranteed to produce unique result? Even if called in sequence in for loop? We have a case when it seemingly produces duplicates. It's intermittent, so we cannot reliably reproduce.
is chance.guid() guaranteed to produce unique result?
No. This is a library for fake data.
In SUT is
v4
method uuid used:What is the best way fake their returning value in Arrange phase?