UniversalMock
A JavaScript object that is everything...
Universal Mock is an object that pretends to have every property, and will return a Universal Mock for everything, so you can do
const mock = require("universalMock");
mock.anythingAtAll === undefined;
mock.anythingAtAll === null;
mock.something.somethingElse.whatever;
let value = mock.someOtherRandom();
You can also set pre-determined value for any mock at any level:
mock.value = 42;
console.log(mock.value);
mock.something = () => "Hello!";
console.log(mock.something());
Universal Mock is useful when you only want to mock out part of an object and don't care about the rest. This is particularly useful in TypeScript where interfaces may require
you to implement everything.