-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor test-fs-read-stream-inherit #10246
Conversation
file5.on('data', function(data) { | ||
file5.data += data.toString('utf-8'); | ||
}); | ||
file5.on('end', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should wrap callbacks with common.mustCall()
if we are calling assert()
within them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more common.mustCall()
. PTAL
@nodejs/testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a suggestion
assert.strictEqual(typeof data, 'string'); | ||
file3.length += data.length; | ||
process.on('exit', function() { | ||
assert.strictEqual(file.length, 30000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this can be checked in file.on('close')
like what's being done for file4.
assert(!file7.destroyed); | ||
file7Next(); | ||
process.on('exit', function() { | ||
assert.strictEqual(file3.length, 10000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation.
Landed in 44e704f |
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: nodejs#10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: #10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: #10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: #10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: #10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refactor to take advantage of block scoping to isolate tests. Checks in exit handlers now reside with the relevant test block. Where test cases start and end is more clear. Also: Some use of `common.mustCall()` and improved wrapping/indentation. PR-URL: #10246 Reviewed-By: Michaël Zasso <targos@protonmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test fs
Description of change
Refactor to take advantage of block scoping to isolate tests. Checks in
exit handlers now reside with the relevant test block. Where test cases
start and end is more clear.
Also: Some use of
common.mustCall()
and improved wrapping/indentation.