Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Aug 26, 2019
1 parent 71ad3c6 commit 3b53003
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/parallel/test-fs-write-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
Expand Down Expand Up @@ -52,3 +52,17 @@ tmpdir.refresh();
});
stream.destroy();
}

// Throws if data is not of type Buffer.
{
const stream = fs.createWriteStream(file);
stream.on('error', common.expectsError({
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError
}));
stream.write(42, null, common.expectsError({
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError
}));
stream.destroy();
}

0 comments on commit 3b53003

Please sign in to comment.