Skip to content

Commit

Permalink
test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored Nov 27, 2024
1 parent 2bbfef1 commit e943c6a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/node_compat/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
"test-fs-open-numeric-flags.js",
"test-fs-open.js",
"test-fs-opendir.js",
"test-fs-promises-file-handle-stat.js",
"test-fs-promises-writefile-with-fd.js",
"test-fs-read-stream-autoClose.js",
"test-fs-read-stream-concurrent-reads.js",
Expand Down
1 change: 0 additions & 1 deletion tests/node_compat/runner/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co
- [parallel/test-fs-promises-file-handle-read-worker.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read-worker.js)
- [parallel/test-fs-promises-file-handle-read.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-read.js)
- [parallel/test-fs-promises-file-handle-readFile.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-readFile.js)
- [parallel/test-fs-promises-file-handle-stat.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stat.js)
- [parallel/test-fs-promises-file-handle-stream.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-stream.js)
- [parallel/test-fs-promises-file-handle-sync.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-sync.js)
- [parallel/test-fs-promises-file-handle-truncate.js](https://github.com/nodejs/node/tree/v20.11.1/test/parallel/test-fs-promises-file-handle-truncate.js)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// deno-fmt-ignore-file
// deno-lint-ignore-file

// Copyright Joyent and Node contributors. All rights reserved. MIT license.
// Taken from Node 20.11.1
// This file is automatically generated by `tests/node_compat/runner/setup.ts`. Do not modify this file manually.

'use strict';

const common = require('../common');

// The following tests validate base functionality for the fs.promises
// FileHandle.stat method.

const { open } = require('fs').promises;
const tmpdir = require('../common/tmpdir');
const assert = require('assert');

tmpdir.refresh();

async function validateStat() {
const filePath = tmpdir.resolve('tmp-read-file.txt');
const fileHandle = await open(filePath, 'w+');
const stats = await fileHandle.stat();
assert.ok(stats.mtime instanceof Date);
await fileHandle.close();
}

validateStat()
.then(common.mustCall());

0 comments on commit e943c6a

Please sign in to comment.