Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ctx.call = jest.fn(() =>
Promise.reject(new Errors.MoleculerError("Something happened"))
);
export const Throw404 = (resource: R | undefined, message: string): R => {
if (!resource) {
throw new Errors.MoleculerError(message, 404, 'Not Found');
}
return resource;
};