proxy-mocks
Advanced tools
Weekly downloads
Changelog
v0.1.2
Full Changelog: https://github.com/maxjoehnk/proxy-mocks/compare/v0.1.1...v0.1.2
Readme
Generate mocks for any class or object.
// 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
Provide mocks utilizing the Proxy API
The npm package proxy-mocks receives a total of 722 weekly downloads. As such, proxy-mocks popularity was classified as not popular.
We found that proxy-mocks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.