mirror of
https://github.com/denoland/deno.git
synced 2025-01-04 21:38:47 -05:00
test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (#27074)
This commit is contained in:
parent
2bbfef137c
commit
e943c6a25d
3 changed files with 31 additions and 1 deletions
|
@ -338,6 +338,7 @@
|
||||||
"test-fs-open-numeric-flags.js",
|
"test-fs-open-numeric-flags.js",
|
||||||
"test-fs-open.js",
|
"test-fs-open.js",
|
||||||
"test-fs-opendir.js",
|
"test-fs-opendir.js",
|
||||||
|
"test-fs-promises-file-handle-stat.js",
|
||||||
"test-fs-promises-writefile-with-fd.js",
|
"test-fs-promises-writefile-with-fd.js",
|
||||||
"test-fs-read-stream-autoClose.js",
|
"test-fs-read-stream-autoClose.js",
|
||||||
"test-fs-read-stream-concurrent-reads.js",
|
"test-fs-read-stream-concurrent-reads.js",
|
||||||
|
|
|
@ -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-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-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-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-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-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)
|
- [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)
|
||||||
|
|
|
@ -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());
|
Loading…
Reference in a new issue