From 37b22e3ba418fa6ca9a61108538ac5c507a10793 Mon Sep 17 00:00:00 2001 From: hasundue Date: Wed, 7 Feb 2024 15:43:53 +0900 Subject: [PATCH] test(file): use LF for EOL --- lib/file_test.ts | 4 ++-- lib/std/fs.ts | 2 +- lib/testing.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/file_test.ts b/lib/file_test.ts index 50a67bdd..c8c64edd 100644 --- a/lib/file_test.ts +++ b/lib/file_test.ts @@ -1,5 +1,5 @@ import { basename, dirname } from "./std/path.ts"; -import { EOL, formatEOL } from "./std/fs.ts"; +import { formatEOL, LF } from "./std/fs.ts"; import { FileSystemFake, ReadTextFileStub, @@ -47,7 +47,7 @@ async function assertFileSystemSnapshot( ) { await assertSnapshot( t, - Array.from(fs.entries()).map(([, content]) => formatEOL(content, EOL)), + Array.from(fs.entries()).map(([, content]) => formatEOL(content, LF)), ); } diff --git a/lib/std/fs.ts b/lib/std/fs.ts index ca2b0431..ebbd6f7e 100644 --- a/lib/std/fs.ts +++ b/lib/std/fs.ts @@ -1,6 +1,6 @@ export { existsSync } from "https://deno.land/std@0.213.0/fs/exists.ts"; export { detect as detectEOL, - EOL, format as formatEOL, + LF, } from "https://deno.land/std@0.213.0/fs/eol.ts"; diff --git a/lib/testing.ts b/lib/testing.ts index 1407d010..57c0ba5f 100644 --- a/lib/testing.ts +++ b/lib/testing.ts @@ -1,5 +1,5 @@ import { createAssertSnapshot, spy, Stub, stub } from "./std/testing.ts"; -import { EOL, formatEOL } from "./std/fs.ts"; +import { formatEOL, LF } from "./std/fs.ts"; import { fromFileUrl } from "./std/path.ts"; export const assertSnapshot = createAssertSnapshot({ @@ -65,7 +65,7 @@ export const WriteTextFileStub = { Deno, "writeTextFile", (path, data) => { - fs.set(path.toString(), formatEOL(data.toString(), EOL)); + fs.set(path.toString(), formatEOL(data.toString(), LF)); return Promise.resolve(); }, );