jeudi 7 mai 2015

Generating unique test data with node

I'm currently using chance.js to generate test data. For example, I can generate a random email and use it to test my models.

My problem is that I need to ensure some fields on my models are unique e.g. email on the user model. Does chance ensure that it doesn't generate the same email twice?

I'd be willing to use faker as an alternative but I couldn't find out if faker offered this functionality.

Aucun commentaire:

Enregistrer un commentaire