From c3fda4422e4bec8d20610e842a831d7abfd306e6 Mon Sep 17 00:00:00 2001 From: Brandon Mills Date: Fri, 1 Jan 2021 16:51:08 -0500 Subject: [PATCH] Bind it.only to it --- designs/2020-rule-tester-only/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designs/2020-rule-tester-only/README.md b/designs/2020-rule-tester-only/README.md index 815ffae3..e638ba4f 100644 --- a/designs/2020-rule-tester-only/README.md +++ b/designs/2020-rule-tester-only/README.md @@ -46,7 +46,7 @@ To allow using `RuleTester` with a custom test framework other than Mocha, paral 1. Add an `itOnly` `set` accessor that sets `RuleTester[IT_ONLY]`. 1. Add an `itOnly` `get` accessor. 1. If `RuleTester[IT_ONLY]` is set, return it. - 2. If global `it` and `it.only` are functions, return `it.only`. *TODO: Is `this` necessary? Could return a wrapper instead.* + 2. If global `it` and `it.only` are functions, return `Function.bind.call(it.only, it)`. 3. Throw an error: 1. If either `RuleTester[DESCRIBE]` or `RuleTester[IT]` is customized, recommend setting a custom `RuleTester.itOnly`. 2. If global `it` is a function, the current test framework does not support `only`.