diff --git a/test/lib/fs.lstat.spec.js b/test/lib/fs.lstat.spec.js index 6b1fdcf..f0442a1 100644 --- a/test/lib/fs.lstat.spec.js +++ b/test/lib/fs.lstat.spec.js @@ -30,7 +30,7 @@ describe('fs.lstat(path, callback)', function() { } assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); done(); }); }); @@ -54,7 +54,7 @@ describe('fs.lstat(path, callback)', function() { } assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); done(); }); }); @@ -75,7 +75,7 @@ describe('fs.lstat(path, callback)', function() { fs.promises.lstat('link').then(function(stats) { assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); done(); }, done); }); @@ -99,7 +99,7 @@ describe('fs.lstat(path, callback)', function() { } assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); - assert.equal(stats.mtimeMs, 1); + assert.equal(stats.mtime.getTime(), 1); done(); }); }); @@ -120,7 +120,7 @@ describe('fs.lstat(path, callback)', function() { fs.promises.lstat('file.txt').then(function(stats) { assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); - assert.equal(stats.mtimeMs, 1); + assert.equal(stats.mtime.getTime(), 1); done(); }, done); }); @@ -177,7 +177,7 @@ describe('fs.lstatSync(path)', function() { const stats = fs.lstatSync('link'); assert.isTrue(stats.isSymbolicLink()); assert.isFalse(stats.isFile()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); }); inVersion('>=10.5.0').it('stats a symbolic link with bigint', function() { @@ -191,7 +191,7 @@ describe('fs.lstatSync(path)', function() { const stats = fs.lstatSync('file.txt'); assert.isTrue(stats.isFile()); assert.isFalse(stats.isSymbolicLink()); - assert.equal(stats.mtimeMs, 1); + assert.equal(stats.mtime.getTime(), 1); }); inVersion('>=10.5.0').it('stats a regular file with bigint', function() { diff --git a/test/lib/fs.stat-fstat.spec.js b/test/lib/fs.stat-fstat.spec.js index a166aa6..82b42d8 100644 --- a/test/lib/fs.stat-fstat.spec.js +++ b/test/lib/fs.stat-fstat.spec.js @@ -52,7 +52,7 @@ describe('fs.stat(path, callback)', function() { } assert.isTrue(stats.isFile()); assert.isFalse(stats.isDirectory()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); done(); }); }); @@ -76,7 +76,7 @@ describe('fs.stat(path, callback)', function() { } assert.isTrue(stats.isFile()); assert.isFalse(stats.isDirectory()); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); done(); }); }); @@ -101,7 +101,7 @@ describe('fs.stat(path, callback)', function() { assert.isTrue(stats.isFile()); assert.isFalse(stats.isDirectory()); done(); - assert.equal(stats.mtimeMs, 2); + assert.equal(stats.mtime.getTime(), 2); }, done); }); @@ -166,9 +166,9 @@ describe('fs.stat(path, callback)', function() { if (err) { return done(err); } - assert.equal(stats.ctimeMs, 1); - assert.equal(stats.mtimeMs, 2); - assert.equal(stats.atimeMs, 3); + assert.equal(stats.ctime.getTime(), 1); + assert.equal(stats.mtime.getTime(), 2); + assert.equal(stats.atime.getTime(), 3); assert.equal(stats.uid, 42); assert.equal(stats.gid, 43); assert.equal(stats.nlink, 1); @@ -195,9 +195,9 @@ describe('fs.stat(path, callback)', function() { withPromise.it('promise provides file stats', function(done) { fs.promises.stat('/path/to/file.txt').then(function(stats) { - assert.equal(stats.ctimeMs, 1); - assert.equal(stats.mtimeMs, 2); - assert.equal(stats.atimeMs, 3); + assert.equal(stats.ctime.getTime(), 1); + assert.equal(stats.mtime.getTime(), 2); + assert.equal(stats.atime.getTime(), 3); assert.equal(stats.uid, 42); assert.equal(stats.gid, 43); assert.equal(stats.nlink, 1);