Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
expected: 8
});
// another case
assert({
given: "a population with 20 members",
should: "return an array of 20",
actual: filterGenome(neat.population, (new Network(2, 2)), pickGenome, adjustGenome).length,
expected: 20
});
// another case
assert({
given: "an pickGenome function that doesn't return a boolean",
should: 'throw an error',
actual: Try(filterGenome, neat.population, (new Network(2, 2)), () => { return "a string" }, adjustGenome),
expected: new Error("pickGenome must always return a boolean!")
});
// another case
assert({
given: "an adjustGenome function that doesn't return a network",
should: 'throw an error',
actual: Try(filterGenome, neat.population, (new Network(2, 2)), pickGenome, () => { return "a string" }),
expected: new Error('adjustGenome must always return a network!')
});
});
expected: 20
});
// another case
assert({
given: "an pickGenome function that doesn't return a boolean",
should: 'throw an error',
actual: Try(filterGenome, neat.population, (new Network(2, 2)), () => { return "a string" }, adjustGenome),
expected: new Error("pickGenome must always return a boolean!")
});
// another case
assert({
given: "an adjustGenome function that doesn't return a network",
should: 'throw an error',
actual: Try(filterGenome, neat.population, (new Network(2, 2)), pickGenome, () => { return "a string" }),
expected: new Error('adjustGenome must always return a network!')
});
});