From be5c6bb361f3aa35b84ada33579f43821851f6d2 Mon Sep 17 00:00:00 2001 From: Joern Bernhardt Date: Mon, 22 Jun 2015 15:50:25 +0200 Subject: [PATCH] Change time check assertions for modification and access times Signed-off-by: Joern Bernhardt --- lib/copy/__tests__/copy.test.js | 8 ++++---- lib/copy/__tests__/sync/copy-sync.test.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/copy/__tests__/copy.test.js b/lib/copy/__tests__/copy.test.js index 664a2939..9320aabc 100644 --- a/lib/copy/__tests__/copy.test.js +++ b/lib/copy/__tests__/copy.test.js @@ -219,11 +219,11 @@ describe('fs-extra', function () { var fromStat = fs.statSync(a) var toStat = fs.statSync(b) if (options.preserveTimestamps) { - assert.deepEqual(toStat.mtime, fromStat.mtime) - assert.deepEqual(toStat.atime, fromStat.atime) + assert.strictEqual(toStat.mtime.getTime(), fromStat.mtime.getTime()) + assert.strictEqual(toStat.atime.getTime(), fromStat.atime.getTime()) } else { - assert.notEqual(toStat.mtime, fromStat.mtime) - assert.notEqual(toStat.atime, fromStat.atime) + assert.notEqual(toStat.mtime.getTime(), fromStat.mtime.getTime()) + // the access time might actually be the same, so check only modification time } } } diff --git a/lib/copy/__tests__/sync/copy-sync.test.js b/lib/copy/__tests__/sync/copy-sync.test.js index 4dbcaca0..d8d29dbb 100644 --- a/lib/copy/__tests__/sync/copy-sync.test.js +++ b/lib/copy/__tests__/sync/copy-sync.test.js @@ -336,11 +336,11 @@ describe('+ copySync()', function () { var fromStat = fs.statSync(a) var toStat = fs.statSync(b) if (options.preserveTimestamps) { - assert.deepEqual(toStat.mtime, fromStat.mtime) - assert.deepEqual(toStat.atime, fromStat.atime) + assert.strictEqual(toStat.mtime.getTime(), fromStat.mtime.getTime()) + assert.strictEqual(toStat.atime.getTime(), fromStat.atime.getTime()) } else { - assert.notEqual(toStat.mtime, fromStat.mtime) - assert.notEqual(toStat.atime, fromStat.atime) + assert.notEqual(toStat.mtime.getTime(), fromStat.mtime.getTime()) + // the access time might actually be the same, so check only modification time } } }