Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grossvogel/6b7420ba24c9317d4c87a89a23dd7734 to your computer and use it in GitHub Desktop.
Save grossvogel/6b7420ba24c9317d4c87a89a23dd7734 to your computer and use it in GitHub Desktop.
const jsc = require('jsverify');
describe('addition', () => {
it('is commutative'() => {
const commutativeTest = (a, b) => add(a, b) === add(b, a);
const commutativeProperty = jsc.forall(jsc.number, jsc.number, commutativeTest);
jsc.assert(commutativeProperty);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment