Skip to content

Instantly share code, notes, and snippets.

@dubzzz
Created July 2, 2020 17:25
Show Gist options
  • Save dubzzz/82d0b4a1ed020ebdaf51e0625fd837bc to your computer and use it in GitHub Desktop.
Save dubzzz/82d0b4a1ed020ebdaf51e0625fd837bc to your computer and use it in GitHub Desktop.
miniFc.assert = property => {
for (let runId = 0 ; runId !== 100 ; ++runId) {
const seed = runId;
const mrng = new Random(prand.xoroshiro128plus(seed));
const valueUnderTest = property.generate(mrng);
if (!property.run(valueUnderTest)) {
throw new Error(`Property failed after ${runId + 1} runs with value ${JSON.stringify(valueUnderTest)}`);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment