Socket
Socket
Sign inDemoInstall

spy4js

Package Overview
Dependencies
1
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous1245
8Next

3.0.0

Diff

Changelog

Source

[3.0.0] - 2020-11-01

Fixed

  • spy.getAllCallArguments was returning a wrong value.

Removed

  • flow support
  • node support for versions lower than 12

Added

  • Better TS support and improved auto-import for package users.

Changed

  • new Spy() -> Spy() (Spy is no longer a class)
vluft
published 2.11.0 •

vluft
published 2.10.0 •

Changelog

Source

[2.10.0] - 2019-11-06

Added

  • spy.getAllCallArguments: Provides a little more flexibility when observing call arguments.
vluft
published 2.9.3 •

vluft
published 2.9.2 •

vluft
published 2.9.1 •

Changelog

Source

[2.9.1] - 2019-11-04

Fixed

  • Fixed node module resolution for Spy.mockModule
vluft
published 2.9.0 •

Changelog

Source

[2.9.0] - 2019-11-03

Added

  • Spy.MAPPER: A nice shortcut variant of Spy.COMPARE to test the output of given function depending on some defined input. See here for more details.
vluft
published 2.8.0 •

Changelog

Source

[2.8.0] - 2019-11-03

Added

  • Spy.mockModule: Allows you to mock functions on module level. Can replace the usage of jest.mock in most situations. One example:

    // some module with name "my-module.js"
    export const useMe = (some: string) => 'foo' + some;
    
    // testing somewhere else
    const Mock$MyModule = Spy.mockModule('../my-stuff/my-module', 'useMe');
    
    Mock$MyModule.useMe.returns(42);
    
    expect(useMe('test')).toBe(42);
    
    Mock$MyModule.useMe.hasCallHistory('test');
    
vluft
published 2.7.0 •

Changelog

Source

[2.7.0] - 2019-11-03

Changed

  • More detailed error messages.

    • Before: --> foo / different string
    • Now: --> foo / different string ['bar' != 'test']
  • Improved UX for Spy.COMPARE. You can make assertions that throw instead of returning a boolean indicator. E.g.

    spy.wasCalledWith(Spy.COMPARE(fn => {
        expect(fn()).toEqual({ foo: 'bar' });
    }));
    
vluft
published 2.6.1 •

Changelog

Source

[2.6.1] - 2019-08-26

Changed

  • Allow to spy on all kind of bound methods (e.g. window.console.error which is no instance of Function on JSDom)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc