From e4088899a222a3f4b65c9fd43c21107710caeee4 Mon Sep 17 00:00:00 2001 From: Erik Kemperman Date: Wed, 25 Oct 2017 16:53:28 +0200 Subject: [PATCH] Document Windows quirk --- test/file-operations.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/file-operations.js b/test/file-operations.js index f1b4961e..2814123b 100644 --- a/test/file-operations.js +++ b/test/file-operations.js @@ -936,7 +936,13 @@ describe('reflectMetadata', function() { reflectMetadata(true, symlinkPath, file, function() { // Not sure why .toEqual doesn't match these Object.keys(file.stat).forEach(function(key) { - expect(file.stat[key]).toEqual(stat[key]); + // There appears to be a bug in the Windows implementation which causes + // the sync versions of stat and lstat to return unsigned 32-bit ints + // whilst the async versions returns signed 32-bit ints... This affects + // dev but possibly others as well? + if (!isWindows || key !== 'dev') { + expect(file.stat[key]).toEqual(stat[key]); + } }); done(); @@ -952,7 +958,13 @@ describe('reflectMetadata', function() { reflectMetadata(false, symlinkPath, file, function() { // Not sure why .toEqual doesn't match these Object.keys(file.stat).forEach(function(key) { - expect(file.stat[key]).toEqual(stat[key]); + // There appears to be a bug in the Windows implementation which causes + // the sync versions of stat and lstat to return unsigned 32-bit ints + // whilst the async versions returns signed 32-bit ints... This affects + // dev but possibly others as well? + if (!isWindows || key !== 'dev') { + expect(file.stat[key]).toEqual(stat[key]); + } }); done();