ppau / project-m

Something secret but not really.
GNU General Public License v3.0
6 stars 8 forks source link

Fix Math.random in acceptance tests to be more... random #79

Closed Doddzy closed 8 years ago

Doddzy commented 8 years ago

In the user signup test, since email has to be unique, there is a math.random() changing the email, this will sometimes fail if it collides with existing user, find a solution to this.

aewens commented 8 years ago
require('crypto').randomBytes(48, function(ex, buf) {
  var token = buf.toString('hex');
});

or

var token = crypto.randomBytes(64).toString('hex');

Would either of these solve your problem?