Ad
  • Default User Avatar

    Thanks! I'm trying to figure it out, and came up with this..
    I can generate random test with a loop, but don't know how to make it work
    in the test fixture...Would anyone be able to look at this below and let me know if i'm on the rght track?

    function random(min, max) {
     const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
     const LENGTH = random(min, (max / 2));
     const letters = "abcdefghijklmnopqrstuvwxyz";
     let arr = [];
     for(let i = 0; i < LENGTH; i++) {
    	arr.push(random(min, max), letters[random(min, 26)]);
     }
     return arr.filter(val => val !== undefined);
     
    }
    
    function randomTest() {
    var results = random(1, 100);
    randomTest.finals = sortAndSum.apply(this, results);
    return results;
    }
    
    console.log("random test is: ", sortAndSum(randomTest()));
    console.log("Final resuls is: ", randomTest.finals);
    
  • Default User Avatar

    This issue was resolved!

  • Default User Avatar

    Null issue resolved!

  • Default User Avatar

    Good catch, I will fix the null issue. Regarding Random tests.... Would anyone be willing to share any links to tutorials / documentation on how to get them set up? I am new to testing and want to make sure to do it right!

    thanks!