Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis. Learn more
Socket
Log inDemoInstall

proxy-mocks

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

proxy-mocks

Provide mocks utilizing the Proxy API

    0.1.2latest
    GitHub

Version published
Maintainers
1
Weekly downloads
723
increased by1.26%

Weekly downloads

Changelog

Source

v0.1.2

Other Changes

  • transpile to commonjs instead of es module

Full Changelog: https://github.com/maxjoehnk/proxy-mocks/compare/v0.1.1...v0.1.2

Readme

Source

proxy-mocks

Generate mocks for any class or object.

Example

// import { IMock, Mock } from 'proxy-mocks/jest'; import { IMock, Mock } from "proxy-mocks/sinon"; import Dependency from "./dependency"; import Implementation from "./implementation"; describe("Implementation", () => { let dependency: IMock<Dependency>; let implementation: Implementation; beforeEach(() => { dependency = Mock.of(Dependency); implementation = new Implementation(dependency); }); test("your test", () => { dependency.someMethod.returns("your result"); const result = implementation.anotherMethod(); expect(result).toEqual("your result"); }); });

FAQs

Last updated on 09 Apr 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • 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