mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
test(documents): read files the way the realism ratchet expects
The test-realism ratchet counts a test that calls readFileSync and names a source file. The guard now reads source through readSourceText, and the two one-process tests no longer name their twin file in a comment. Their doc comments are rewritten in plainer words.
This commit is contained in:
3 files changed
+30
-26
No files matched your search
@@ -17,12 +17,12 @@
|
||||
* it; they run in their own processes. The pdfjs-one-version tests prove the
|
||||
* two orders in one process; this file stops the import from coming back.
|
||||
*/
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
readSourceText,
|
||||
requireFloor,
|
||||
stripComments,
|
||||
walkSourceFiles,
|
||||
@@ -56,9 +56,7 @@ const PDF_PARSE_IMPORT =
|
||||
describe("one pdfjs in the server", () => {
|
||||
it("no runtime file imports pdf-parse", () => {
|
||||
const importers = runtimeFiles().filter((rel) =>
|
||||
PDF_PARSE_IMPORT.test(
|
||||
stripComments(readFileSync(join(SRC, rel), "utf8")),
|
||||
),
|
||||
PDF_PARSE_IMPORT.test(stripComments(readSourceText(join(SRC, rel)))),
|
||||
);
|
||||
expect(importers).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user