Neophobe Plebeian Mumpsimus

    call-spy
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.2 • Public • Published

    callSpy

    Tiny function for spying on function calls.

    Install

    $ npm install --save call-spy

    Usage

    import callSpy from 'call-spy';
     
    const [fn, result] = callSpy ( () => 'yay' );
     
    result.called; // false
    result.calls; // 0
     
    fn ( 1, 2, 3 ); // 'yay!'
     
    result.called; // true
    result.calls; // 1
    result.return; // 'yay!'
    result.arguments; // [1, 2, 3]

    License

    MIT © Fabio Spampinato

    Keywords

    Install

    npm i call-spy

    DownloadsWeekly Downloads

    14

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    8.09 kB

    Total Files

    13

    Last publish

    Collaborators

    • fabiospampinato