techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.7K
active users

#flakytests

1 post1 participant0 posts today

If there is more than one call to `faker.seed` in your entire test suite then you are *very* likely to hit many problems once the code grows big.

One of the easiest way to show almost guaranteed free lying rake is the concept of IDs that in most cases *need* to be unique for different instances of the same model. For that faker has cool function `uuid()` that promise to give you exactly that ... unless you use `seed`:

```
faker.seed(1);
const uuid1 = faker.datatype.uuid();

...

faker.seed(1);
const uuid2 = faker.datatype.uuid();

console.log(uuid1 === uuid2); // true
```

There are many others and even if you think this does not apply to your case the unnecessary risk is IMO way too high to instil this in your code.

#faker#testing#seed