• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3// Test that http.ClientRequest,prototype.destroy() returns `this`.
4require('../common');
5
6const assert = require('assert');
7const http = require('http');
8const clientRequest = new http.ClientRequest({ createConnection: () => {} });
9
10assert.strictEqual(clientRequest.destroyed, false);
11assert.strictEqual(clientRequest.destroy(), clientRequest);
12assert.strictEqual(clientRequest.destroyed, true);
13assert.strictEqual(clientRequest.destroy(), clientRequest);
14