Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 26, 2024
1 parent b591ff4 commit cac9a30
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/parallel/test-fs-stat.js
Expand Up @@ -179,3 +179,34 @@ fs.lstat(__filename, undefined, common.mustCall());
]
});
}

// Stat Date properties can be set before reading them
fs.stat(__filename, common.mustSucceed((s) => {
s.atime = 2;
s.mtime = 3;
s.ctime = 4;
s.birthtime = 5;

assert.strictEqual(s.atime, 2);
assert.strictEqual(s.mtime, 3);
assert.strictEqual(s.ctime, 4);
assert.strictEqual(s.birthtime, 5);
}));

// Stat Date properties can be set after reading them
fs.stat(__filename, common.mustSucceed((s) => {
s.atime;

Check failure on line 198 in test/parallel/test-fs-stat.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected an assignment or function call and instead saw an expression
s.mtime;

Check failure on line 199 in test/parallel/test-fs-stat.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected an assignment or function call and instead saw an expression
s.ctime;

Check failure on line 200 in test/parallel/test-fs-stat.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected an assignment or function call and instead saw an expression
s.birthtime;

Check failure on line 201 in test/parallel/test-fs-stat.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Expected an assignment or function call and instead saw an expression

s.atime = 2;
s.mtime = 3;
s.ctime = 4;
s.birthtime = 5;

assert.strictEqual(s.atime, 2);
assert.strictEqual(s.mtime, 3);
assert.strictEqual(s.ctime, 4);
assert.strictEqual(s.birthtime, 5);
}));

0 comments on commit cac9a30

Please sign in to comment.