summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-writable-properties.js
blob: 424bb5871083a2db7d85f7a399c6c59046e51125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
require('../common');
const assert = require('assert');

const { Writable } = require('stream');

{
  const w = new Writable();
  assert.strictEqual(w.writableCorked, 0);
  w.uncork();
  assert.strictEqual(w.writableCorked, 0);
  w.cork();
  assert.strictEqual(w.writableCorked, 1);
  w.cork();
  assert.strictEqual(w.writableCorked, 2);
  w.uncork();
  assert.strictEqual(w.writableCorked, 1);
  w.uncork();
  assert.strictEqual(w.writableCorked, 0);
  w.uncork();
  assert.strictEqual(w.writableCorked, 0);
}