noExit
By setting noExit to true, Poku won't exit the process and will return the exit code (0 or 1).
You can combine this option with Poku's exit method or just use the result, for example: process.exit(code).
APIβ
import { poku, exit } from 'poku';
const unit = await poku('test/unit', {
noExit: true,
parallel: true,
quiet: true,
});
// do something
const integration = await poku('test/integration', {
noExit: true,
quiet: true,
});
// do something more
const code = unit === 0 && integration === 0 ? 0 : 1;
// do something more again
exit(code);
Then, run the file directly with the preferred platform, for example:
node test/run.test.jsnpx tsx test/run.test.ts