Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 13, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected 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.

@Trott Trott added fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests. labels Dec 13, 2016
file5.on('data', function(data) {
file5.data += data.toString('utf-8');
});
file5.on('end', function() {
Copy link
Contributor

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.

Copy link
Member Author

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

@italoacasas
Copy link
Contributor

italoacasas commented Dec 13, 2016

@italoacasas
Copy link
Contributor

@nodejs/testing

Copy link
Member

@targos targos left a 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);
Copy link
Member

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);
Copy link
Member

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.
@Trott
Copy link
Member Author

Trott commented Dec 15, 2016

@Trott
Copy link
Member Author

Trott commented Dec 16, 2016

Landed in 44e704f

Trott added a commit to Trott/io.js that referenced this pull request Dec 16, 2016
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>
@Trott Trott closed this Dec 16, 2016
italoacasas pushed a commit that referenced this pull request Dec 17, 2016
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>
@italoacasas italoacasas mentioned this pull request Dec 17, 2016
cjihrig pushed a commit that referenced this pull request Dec 20, 2016
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>
MylesBorins pushed a commit that referenced this pull request Jan 22, 2017
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>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
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>
@Trott Trott deleted the inherit branch January 13, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants