MCPcopy Create free account
hub / github.com/denoland/std / runTest

Function runTest

testing/snapshot_test.ts:297–320  ·  view source on GitHub ↗
(test: string)

Source from the content-addressed store, hash-verified

295 const snapshotName = "snapshot";
296
297 async function runTest(test: string) {
298 const tempTestFileName = "test.ts";
299 const tempTestFilePath = join(tempDir, tempTestFileName);
300 await Deno.writeTextFile(tempTestFilePath, test);
301
302 const process = new Deno.Command(Deno.execPath(), {
303 args: [
304 "test",
305 "--no-lock",
306 "--allow-all",
307 tempTestFilePath,
308 "--",
309 "-u",
310 ],
311 stdout: "piped",
312 stderr: "piped",
313 });
314 const { stdout, stderr } = await process.output();
315
316 return {
317 output: new TextDecoder().decode(stdout),
318 error: new TextDecoder().decode(stderr),
319 };
320 }
321
322 const result = await runTest(`
323 import { assertSnapshot } from "${SNAPSHOT_MODULE_URL}";

Callers 1

snapshot_test.tsFile · 0.85

Calls 1

joinFunction · 0.90

Tested by

no test coverage detected