MCPcopy
hub / github.com/tinyplex/tinybase / test

Function test

gulpfile.mjs:657–688  ·  view source on GitHub ↗
(dirs, coverage)

Source from the content-addressed store, hash-verified

655};
656
657const test = async (dirs, coverage) => {
658 const {startVitest} = await import('vitest/node');
659
660 await clearDir(TMP_DIR);
661 const vitest = await startVitest(
662 'test',
663 [...dirs],
664 {watch: false, coverage: {enabled: coverage}},
665 {},
666 {watch: false},
667 );
668 await vitest.close();
669
670 if (vitest.state.getCountOfFailedTests() > 0) {
671 await removeDir(TMP_DIR);
672
673 throw 'Test failed';
674 }
675
676 if (coverage) {
677 await promises.writeFile(
678 'coverage.json',
679 JSON.stringify({
680 ...JSON.parse(await promises.readFile('./tmp/counts.json')),
681 ...JSON.parse(
682 await promises.readFile('./tmp/coverage/coverage-summary.json'),
683 ).total,
684 }),
685 UTF8,
686 );
687 }
688};
689
690const compileModulesForProd = async () => {
691 await clearDir(DIST_DIR);

Callers 15

testUnitFunction · 0.70
testUnitFastFunction · 0.70
testDocsFunction · 0.70
testPerfFunction · 0.70
testProdFunction · 0.70
hooks.test.tsxFile · 0.50
testStateFunctionsFunction · 0.50
testStoreReadFunctionsFunction · 0.50

Calls 3

clearDirFunction · 0.85
removeDirFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…