chai-spies-augment
Additions to the chai-spies library
Adds:
- Ability to easily inspect the parameters a spy has been called with
- Ability to check if a spy was called with a partial object
Install
npm install --save-dev chai-spies-augment
Then in your test setup file where you are loading chai spies
;;...chai;chai;
Usage
Accessing spy call parameters
const spy = chai; ;; const args = spy; // ['a', 'b', 'c']const argsFor = spy; // [1, 2, 3]
Checking for partial object
const spy = chai; ;; tohavebeencalledwith; // truetohavebeencalledwith; // true