summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-listening.js
blob: 3fd93f3e2e0b260f911586f09811e48949d93871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');

const server = http.createServer();

assert.strictEqual(server.listening, false);

server.listen(0, common.mustCall(() => {
  assert.strictEqual(server.listening, true);

  server.close(common.mustCall(() => {
    assert.strictEqual(server.listening, false);
  }));
}));