From 7c4cccb0070f7fd0fb9dc55ce379b8e117f92f64 Mon Sep 17 00:00:00 2001 From: ssube Date: Sun, 25 Jul 2021 12:30:31 -0500 Subject: [PATCH] clarify suite defined by over, link to Chai assertions --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ca46ffa..626c7c6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Add `mocha-foam` to your project as a dev dependency, along with `fast-check`, i This is a BDD-style wrapper around `fc.check(fc.asyncProperty(...))`, and supports all of the same [Arbitraries](https://github.com/dubzzz/fast-check/blob/main/documentation/Arbitraries.md) that fast-check normally provides. -The entrypoint function is `over` and the library is provided as an ES module: +Property based suites are defined with `over` and the library is provided as an ES module: ```typescript import { expect } from 'chai'; @@ -44,12 +44,13 @@ describe('example properties', () => { }); ``` -Assertions can be made through `expect` (and the other chai assertions) or by returning a boolean, and may be `async` -functions. The test callbacks are called with a Mocha context, so [the usual caveats](https://mochajs.org/#arrow-functions) apply. +Assertions can be made through `expect` (and [the other Chai assertion styles](https://www.chaijs.com/guide/styles/)) +or by returning a boolean, and may be `async` functions. The test callbacks are called with a Mocha context in `this`, +so [the usual caveats](https://mochajs.org/#arrow-functions) apply to arrow functions. -Note the wrapped `it` passed to the suite callback by `over`. This calls through to Mocha's `it`, after wrapping the -test in a fast-check property. Most Mocha features, like `beforeEach` and `afterEach` hooks, work correctly within -the suite defined by `over`. +Note the wrapped `it` passed to the suite callback by `over`. This wrapped `it` calls through to Mocha's `it`, after +wrapping the test in a fast-check property, while `over` calls through to Mocha's `describe`. Most Mocha features, +like `beforeEach` and `afterEach` hooks, work correctly within the suite defined by `over`. You can pass additional parameters to the fast-check Runner after the suite callback: