You can override the Math.random method right before you run the function.
Math.random
Math.random = function() { return 0 };
Depending on your setup, it's best to have each test independent so that it won't affect the other tests.