Skip to content

Commit

Permalink
tests: fix birthtime not available on tmpfs on Linux (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Jan 19, 2021
1 parent d409cf8 commit 76d38fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/copy-sync/__tests__/copy-sync-dir.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('+ copySync() / dir', () => {
it('should apply filter when it is applied only to dest', done => {
const timeCond = new Date().getTime()

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

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions lib/copy/__tests__/copy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ describe('fs-extra', () => {
it('should apply filter when it is applied only to dest', done => {
const timeCond = new Date().getTime()

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

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

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

const dest = path.join(TEST_DIR, 'dest')
setTimeout(() => {
Expand Down

0 comments on commit 76d38fc

Please sign in to comment.