Skip to content

Instantly share code, notes, and snippets.

@gunar
Last active March 7, 2019 15:54
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 gunar/4b0e446d4a572fdfb253a02cda2f3d69 to your computer and use it in GitHub Desktop.
Save gunar/4b0e446d4a572fdfb253a02cda2f3d69 to your computer and use it in GitHub Desktop.
Property-based Testing example (pseudo-code).
// Property-based Testing example (pseudo-code).
test([Number], anArrayOfNumbers => {
// ↑↑↑↑↑↑↑↑↑↑ ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
// The schema. The generated test-data.
assert.deepEqual(
mySort([anArrayOfNumbers]),
Array.prototype.sort.call(anArrayOfNumbers)
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment