Skip to content

Commit 76d38fc

Browse files
authored
tests: fix birthtime not available on tmpfs on Linux (#861)
1 parent d409cf8 commit 76d38fc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/copy-sync/__tests__/copy-sync-dir.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ describe('+ copySync() / dir', () => {
182182
it('should apply filter when it is applied only to dest', done => {
183183
const timeCond = new Date().getTime()
184184

185-
const filter = (s, d) => fs.statSync(d).birthtime.getTime() < timeCond
185+
const filter = (s, d) => fs.statSync(d).mtime.getTime() < timeCond
186186

187187
const dest = path.join(TEST_DIR, 'dest')
188188

@@ -197,7 +197,7 @@ describe('+ copySync() / dir', () => {
197197

198198
it('should apply filter when it is applied to both src and dest', done => {
199199
const timeCond = new Date().getTime()
200-
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).birthtime.getTime() > timeCond
200+
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).mtime.getTime() > timeCond
201201

202202
const dest = path.join(TEST_DIR, 'dest')
203203

lib/copy/__tests__/copy.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe('fs-extra', () => {
366366
it('should apply filter when it is applied only to dest', done => {
367367
const timeCond = new Date().getTime()
368368

369-
const filter = (s, d) => fs.statSync(d).birthtime.getTime() < timeCond
369+
const filter = (s, d) => fs.statSync(d).mtime.getTime() < timeCond
370370

371371
const src = path.join(TEST_DIR, 'src')
372372
fse.mkdirsSync(src)
@@ -388,7 +388,7 @@ describe('fs-extra', () => {
388388

389389
it('should apply filter when it is applied to both src and dest', done => {
390390
const timeCond = new Date().getTime()
391-
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).birthtime.getTime() > timeCond
391+
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).mtime.getTime() > timeCond
392392

393393
const dest = path.join(TEST_DIR, 'dest')
394394
setTimeout(() => {

0 commit comments

Comments
 (0)