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

Function runWithSample

test/fixtures.ts:146–176  ·  view source on GitHub ↗
(sample: Sample, index: number, total: number)

Source from the content-addressed store, hash-verified

144 }
145
146 async runWithSample(sample: Sample, index: number, total: number) {
147 const cwd = this.getRunDirectory();
148 let sampleFile = path.basename(sample.path);
149 let shouldSkip = this.shouldSkipTest(sample);
150 const additionalFiles = this.additionalFiles(sample);
151
152 this.printRunMessage(sample, index, total, cwd, shouldSkip);
153
154 if (shouldSkip) {
155 return;
156 }
157
158 shell.cp("-R", this.language.base, cwd);
159 shell.cp.apply(null, _.concat(sample.path, additionalFiles, cwd));
160
161 await inDir(cwd, async () => {
162 await this.runQuicktype(sampleFile, sample.additionalRendererOptions);
163
164 try {
165 await this.test(
166 sampleFile,
167 sample.additionalRendererOptions,
168 additionalFiles
169 );
170 } catch (e) {
171 failWith("Fixture threw an exception", { error: e });
172 }
173 });
174
175 shell.rm("-rf", cwd);
176 }
177}
178
179class JSONFixture extends LanguageFixture {

Callers

nothing calls this directly

Calls 6

inDirFunction · 0.90
failWithFunction · 0.90
shouldSkipTestMethod · 0.45
additionalFilesMethod · 0.45
runQuicktypeMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…