From f5df9a3c483392df6e3c3d444ef7ca50bac77d35 Mon Sep 17 00:00:00 2001 From: Joe Lissner Date: Fri, 22 Jan 2021 12:53:10 -0600 Subject: [PATCH] Update README.md removed documentation around partial parameter matches, as that was removed in 3.0 --- README.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c5461b9..afeecb7 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ when(fn).calledWith(1).mockReturnValue('yay!') ``` The trained mock function `fn` will now behave as follows -- assumed no other trainings took place: -* return `yay!` if called with `1` _as first parameter_ -* return `undefined` if called with _any other first parameter_ than `1` +* return `yay!` if called with `1` _as the only parameter_ +* return `undefined` if called with _any parameters other_ than `1` For extended usage see the examples below. @@ -90,14 +90,6 @@ Trainings like `mockReturnValueOnce` are removed after a matching function call Thanks to [@fkloes](https://github.com/fkloes). -#### Supports multiple args with partial argument matching: -```javascript -when(fn).calledWith(1, true).mockReturnValue('yay!') - -expect(fn(1, true)).toEqual('yay!') -expect(fn(1, true, 'foo')).toEqual('yay!') -``` - #### Supports training for single calls ```javascript when(fn).calledWith(1, true, 'foo').mockReturnValueOnce('yay!')