Add schema utils

This commit is contained in:
Jamie Kyle 2024-10-02 12:03:10 -07:00 committed by GitHub
parent c8a729f8be
commit b26466e59d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 674 additions and 151 deletions

View file

@ -13,6 +13,7 @@ import logSymbols from 'log-symbols';
import { explodePromise } from '../util/explodePromise';
import { missingCaseError } from '../util/missingCaseError';
import { SECOND } from '../util/durations';
import { parseUnknown } from '../util/schemas';
const ROOT_DIR = join(__dirname, '..', '..');
@ -137,7 +138,10 @@ async function launchElectron(
return;
}
const event = eventSchema.parse(JSON.parse(match[1]));
const event = parseUnknown(
eventSchema,
JSON.parse(match[1]) as unknown
);
if (event.type === 'pass') {
pass += 1;