Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function newAgent() {
agent.currentTransaction = undefined;
agent.currentSpan = undefined;
agent.currentTraceparent = undefined;
agent.captureError = jest.fn();
agent.startSpan = jest.fn(() => ({
end: jest.fn()
}));
agent.startTransaction = jest.fn(() => ({
end: jest.fn()
}));
return agent;
}