We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2dd473 commit 27921e2Copy full SHA for 27921e2
test/parallel/test-fs-promises-file-handle-stat.js
@@ -0,0 +1,24 @@
1
+'use strict';
2
+
3
+const common = require('../common');
4
5
+// The following tests validate base functionality for the fs/promises
6
+// FileHandle.stat method.
7
8
+const { open } = require('fs/promises');
9
+const path = require('path');
10
+const tmpdir = require('../common/tmpdir');
11
+const assert = require('assert');
12
13
+tmpdir.refresh();
14
+common.crashOnUnhandledRejection();
15
16
+async function validateStat() {
17
+ const filePath = path.resolve(tmpdir.path, 'tmp-read-file.txt');
18
+ const fileHandle = await open(filePath, 'w+');
19
+ const stats = await fileHandle.stat();
20
+ assert.ok(stats.mtime instanceof Date);
21
+}
22
23
+validateStat()
24
+ .then(common.mustCall());
0 commit comments