diff --git a/fs/resources/test-helpers.js b/fs/resources/test-helpers.js index d2e09504d3f611..7fa8bd2a8b4646 100644 --- a/fs/resources/test-helpers.js +++ b/fs/resources/test-helpers.js @@ -5,13 +5,9 @@ const kCurrentDirectory = '.'; const kParentDirectory = '..'; // Array of separators used to separate components in hierarchical paths. -let kPathSeparators; -if (navigator.userAgent.includes('Windows NT')) { - // Windows uses both '/' and '\' as path separators. - kPathSeparators = ['/', '\\']; -} else { - kPathSeparators = ['/']; -} +// Consider both '/' and '\' as path separators to ensure file names are +// platform-agnostic. +let kPathSeparators = ['/', '\\']; async function getFileSize(handle) { const file = await handle.getFile();