summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-listening.js
blob: efa6873345a8b27f836fe9272785ee61154711c4 (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(common.PORT, common.mustCall(() => {
  assert.strictEqual(server.listening, true);

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