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

fix(node/fs): Enable test-fs-read-zero-length.js and test-fs-read-type.js #2692

Merged
merged 13 commits into from
Sep 25, 2022

Conversation

wafuwafu13
Copy link
Contributor

part of: #911

node/_fs/_fs_util.ts Outdated Show resolved Hide resolved
node/_fs/_fs_util.ts Outdated Show resolved Hide resolved
@wafuwafu13
Copy link
Contributor Author

[memo]
https://github.com/denoland/deno_std/actions/runs/3112024713/jobs/5044988623

./node/_fs/_fs_read_test.ts (uncaught error)
error: TypeError: The "position" argument must be of type bigint or integer. Received null
    throw new ERR_INVALID_ARG_TYPE("position", ["integer", "bigint"], position);
          ^
    at __node_internal_ (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_util.ts:23:11)
    at read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read.ts:98:3)
    at file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read_test.ts:33:7
    at file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_open.ts:83:17
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

./node/_fs/_fs_streams_test.ts (uncaught error)
error: TypeError: The "position" argument must be of type bigint or integer. Received null
    throw new ERR_INVALID_ARG_TYPE("position", ["integer", "bigint"], position);
          ^
    at __node_internal_ (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_util.ts:23:11)
    at Object.read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read.ts:98:3)
    at <computed> (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_streams.ts:254:8)
    at new Promise (<anonymous>)
    at ReadStream._read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_streams.ts:252:9)
    at ReadStream.w.read (file:///home/runner/work/deno_std/deno_std/node/_stream.mjs:10:34273)
    at Ql (file:///home/runner/work/deno_std/deno_std/node/_stream.mjs:10:35586)
    at processTicksAndRejections (file:///home/runner/work/deno_std/deno_std/node/_next_tick.ts:41:15)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

 FAILURES 

./node/_fs/_fs_read_test.ts (uncaught error)
./node/_fs/_fs_streams_test.ts (uncaught error)

@wafuwafu13 wafuwafu13 marked this pull request as draft September 23, 2022 11:08
@wafuwafu13 wafuwafu13 marked this pull request as ready for review September 23, 2022 13:08
node/_tools/test/parallel/test-fs-read.js Outdated Show resolved Hide resolved
node/_fs/_fs_util.ts Outdated Show resolved Hide resolved
@@ -66,11 +64,12 @@ export function read(
cb = optOrBufferOrCb;
} else {
offset = offsetOrCallback as number;
if (Number.isNaN(offset)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this check be:

validateInteger(offset, 'offset', 0);

node/_fs/_fs_read.ts Outdated Show resolved Hide resolved
@wafuwafu13 wafuwafu13 marked this pull request as draft September 24, 2022 13:20
@wafuwafu13 wafuwafu13 marked this pull request as ready for review September 25, 2022 09:14
@wafuwafu13 wafuwafu13 requested review from cjihrig and removed request for kt3k and bartlomieju September 25, 2022 09:17
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@cjihrig cjihrig merged commit 6913e73 into denoland:main Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants