%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/
Upload File :
Create Path :
Current File : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/test-http-agent-close.js

'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

const agent = new http.Agent();
const _err = new Error('kaboom');
agent.createSocket = function(req, options, cb) {
  cb(_err);
};

const req = http
  .request({
    agent
  })
  .on('error', common.mustCall((err) => {
    assert.strictEqual(err, _err);
  }))
  .on('close', common.mustCall(() => {
    assert.strictEqual(req.destroyed, true);
  }));

Zerion Mini Shell 1.0