Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...options,
});
// Register default plugins
if (injectPlugin) {
// @ts-ignore Ignore this for convenience
tool.registerPlugin('plugin', Plugin);
}
// Stub out standard objects
tool.args = stubArgs();
tool.config = stubToolConfig(config);
tool.package = stubPackageJson();
// Stub out methods
tool.debug = mockDebugger();
// TODO Remove in 2.0
// @ts-ignore
tool.createDebugger = mockDebugger;
// @ts-ignore Allow private access to avoid loaders
tool.initialized = true;
return tool;
}
export function mockRoutine = TestTool>(
tool: T,
key: string = 'key',
title: string = 'Title',
): Routine {
const routine = new MockRoutine(key, title);
routine.tool = tool;
routine.debug = mockDebugger();
return routine;
}