Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c6618df

Browse filesBrowse files
edsadrItalo A. Casas
authored andcommitted
test: improve test stream transform constructor
* new test for the error when a transform function is not specified * use let instead of var * use assert.strictEqual instead of assert.equal * use arrow functions PR-URL: #10699 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent c217b43 commit c6618df
Copy full SHA for c6618df

File tree

Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-stream-transform-constructor-set-methods.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-transform-constructor-set-methods.js
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ const t = new Transform({
2121
flush: _flush
2222
});
2323

24+
const t2 = new Transform({});
25+
2426
t.end(Buffer.from('blerg'));
2527
t.resume();
2628

27-
process.on('exit', function() {
29+
assert.throws(() => {
30+
t2.end(Buffer.from('blerg'));
31+
}, /^Error: _transform\(\) is not implemented$/);
32+
33+
34+
process.on('exit', () => {
2835
assert.strictEqual(t._transform, _transform);
2936
assert.strictEqual(t._flush, _flush);
30-
assert(_transformCalled);
31-
assert(_flushCalled);
37+
assert.strictEqual(_transformCalled, true);
38+
assert.strictEqual(_flushCalled, true);
3239
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.