Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.on('response', req => {
responseCalled = true;
expect(req.action).to.equal(ACTIONS.PASSTHROUGH);
});
async passthrough(pollyRequest) {
pollyRequest.action = ACTIONS.PASSTHROUGH;
return this.onPassthrough(pollyRequest);
}
import { ACTIONS } from '@pollyjs/utils';
const FORMATTED_ACTIONS = {
[ACTIONS.RECORD]: 'Recorded',
[ACTIONS.REPLAY]: 'Replayed',
[ACTIONS.INTERCEPT]: 'Intercepted',
[ACTIONS.PASSTHROUGH]: 'Passthrough'
};
export default class Logger {
constructor(polly) {
this.polly = polly;
this.groupName = null;
}
connect() {
this._middleware = this.polly.server
.any()
.on('error', (...args) => this.logError(...args))
.on('response', (...args) => this.logRequest(...args));
}
disconnect() {