MCPcopy Create free account
hub / github.com/adobe/react-spectrum / smoke

Function smoke

perf/runner.mjs:507–526  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

505// Without --build it builds a throwaway snapshot of the working tree and removes it
506// afterward; the results directory is kept either way.
507export async function smoke(options) {
508 let begin = Date.now();
509 let name = options.base;
510 let temporary = !name;
511 if (temporary) {
512 name = `smoke-${new Date().toISOString().replaceAll(/[:.]/g, '-')}`;
513 await build(name);
514 }
515 try {
516 let {result, dir} = await run({...options, base: name, candidate: name, quiet: true});
517 let count = result.scenarios.length;
518 console.log(
519 `\nSmoke test passed: ${count} scenario${count === 1 ? '' : 's'}, ${options.blocks} launches, ${Math.round((Date.now() - begin) / 1000)} s. Report: ${path.join(dir, 'report.md')}`
520 );
521 } finally {
522 if (temporary) {
523 await fs.rm(buildPath(name), {recursive: true, force: true});
524 }
525 }
526}

Callers 1

cli.mjsFile · 0.90

Calls 3

buildFunction · 0.90
buildPathFunction · 0.90
runFunction · 0.70

Tested by

no test coverage detected