Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding Countdown to test-http-set-cookies test
  • Loading branch information
shilomagen committed Dec 6, 2017
commit f855134617b42c67635363b2c66e39e22cd25ed8
13 changes: 5 additions & 8 deletions test/parallel/test-http-set-cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const countdown = new Countdown(2, common.mustCall(() => server.close()));
const server = http.createServer(function(req, res) {
if (req.url === '/one') {
res.writeHead(200, [['set-cookie', 'A'],
['content-type', 'text/plain']]);
['content-type', 'text/plain']]);
res.end('one\n');
} else {
res.writeHead(200, [['set-cookie', 'A'],
['set-cookie', 'B'],
['content-type', 'text/plain']]);
['set-cookie', 'B'],
['content-type', 'text/plain']]);
res.end('two\n');
}
});
Expand All @@ -44,7 +44,7 @@ server.on('listening', function() {
//
// one set-cookie header
//
http.get({port: this.address().port, path: '/one'}, function(res) {
http.get({ port: this.address().port, path: '/one' }, function(res) {
// set-cookie headers are always return in an array.
// even if there is only one.
assert.deepStrictEqual(['A'], res.headers['set-cookie']);
Expand All @@ -61,7 +61,7 @@ server.on('listening', function() {

// two set-cookie headers

http.get({port: this.address().port, path: '/two'}, function(res) {
http.get({ port: this.address().port, path: '/two' }, function(res) {
assert.deepStrictEqual(['A', 'B'], res.headers['set-cookie']);
assert.strictEqual('text/plain', res.headers['content-type']);

Expand All @@ -76,6 +76,3 @@ server.on('listening', function() {

});

process.on('exit', function() {
assert.strictEqual(countdown.remaining, 0);
});