forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (d…
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/node_compat/test/parallel/test-fs-promises-file-handle-stat.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); |