diff --git a/node/_fs/_fs_stat_test.ts b/node/_fs/_fs_stat_test.ts index e991985ea8d9..5a25cddcc883 100644 --- a/node/_fs/_fs_stat_test.ts +++ b/node/_fs/_fs_stat_test.ts @@ -17,9 +17,9 @@ export function assertStats(actual: Stats, expected: Deno.FileInfo) { assertEquals(actual.atime?.getTime(), expected.atime?.getTime()); assertEquals(actual.mtime?.getTime(), expected.mtime?.getTime()); assertEquals(actual.birthtime?.getTime(), expected.birthtime?.getTime()); - assertEquals(actual.atimeMs, expected.atime?.getTime()); - assertEquals(actual.mtimeMs, expected.mtime?.getTime()); - assertEquals(actual.birthtimeMs, expected.birthtime?.getTime()); + assertEquals(actual.atimeMs ?? undefined, expected.atime?.getTime()); + assertEquals(actual.mtimeMs ?? undefined, expected.mtime?.getTime()); + assertEquals(actual.birthtimeMs ?? undefined, expected.birthtime?.getTime()); assertEquals(actual.isFile(), expected.isFile); assertEquals(actual.isDirectory(), expected.isDirectory); assertEquals(actual.isSymbolicLink(), expected.isSymlink); @@ -48,9 +48,18 @@ export function assertStatsBigInt( assertEquals(actual.atime?.getTime(), expected.atime?.getTime()); assertEquals(actual.mtime?.getTime(), expected.mtime?.getTime()); assertEquals(actual.birthtime?.getTime(), expected.birthtime?.getTime()); - assertEquals(Number(actual.atimeMs), expected.atime?.getTime()); - assertEquals(Number(actual.mtimeMs), expected.mtime?.getTime()); - assertEquals(Number(actual.birthtimeMs), expected.birthtime?.getTime()); + assertEquals( + actual.atimeMs === null ? undefined : Number(actual.atimeMs), + expected.atime?.getTime(), + ); + assertEquals( + actual.mtimeMs === null ? undefined : Number(actual.mtimeMs), + expected.mtime?.getTime(), + ); + assertEquals( + actual.birthtimeMs === null ? undefined : Number(actual.birthtimeMs), + expected.birthtime?.getTime(), + ); assertEquals(actual.atimeNs === null, actual.atime === null); assertEquals(actual.mtimeNs === null, actual.mtime === null); assertEquals(actual.birthtimeNs === null, actual.birthtime === null);