MCPcopy Create free account
hub / github.com/glideapps/quicktype / jsonTestFiles

Function jsonTestFiles

test/fixtures.ts:41–62  ·  view source on GitHub ↗
(base: string)

Source from the content-addressed store, hash-verified

39}
40
41function jsonTestFiles(base: string): string[] {
42 const jsonFiles: string[] = [];
43 let fn = `${base}.json`;
44 if (fs.existsSync(fn)) {
45 jsonFiles.push(fn);
46 }
47 let i = 1;
48 for (;;) {
49 fn = `${base}.${i.toString()}.json`;
50 if (fs.existsSync(fn)) {
51 jsonFiles.push(fn);
52 } else {
53 break;
54 }
55 i++;
56 }
57
58 if (jsonFiles.length === 0) {
59 return failWith("No JSON input files", { base });
60 }
61 return jsonFiles;
62}
63
64export abstract class Fixture {
65 abstract name: string;

Callers 2

additionalFilesMethod · 0.85
additionalFilesMethod · 0.85

Calls 1

failWithFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…