How to use the riteway.Try function in riteway

To help you get started, we’ve selected a few riteway examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liquidcarrot / carrot / test / unit.js View on Github external
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!')
  });
});
github liquidcarrot / carrot / test / unit.js View on Github external
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!')
  });
});

riteway

Unit tests that always supply a good bug report when they fail.

MIT
Latest version published 10 months ago

Package Health Score

55 / 100
Full package analysis

Popular riteway functions

Similar packages