acuminous / yadda

A BDD javascript library
412 stars 73 forks source link

Any suggestions for implementing factories? #226

Closed FarhadG closed 7 years ago

FarhadG commented 7 years ago

We're currently using a mock data solution where we're testing against a set of data points, however, it's getting quite difficult to manage and I was wondering if we have any good solutions or suggestions for implementing factories where we create the test data on the fly (or any other viable solutions).

cressie176 commented 7 years ago

I usually roll my own solution using a combination of the builder and Object Mother patterns. I'm always careful to generate random values for anything I'm not asserting. I've found chance quite useful for this.

FarhadG commented 7 years ago

Thanks for the response, @cressie176. Would you happen to have any code I can look at in regards to Yadda?

cressie176 commented 7 years ago

No sorry.