fix: suppress worker-not-found warnings in test environment

The TeamDataWorkerClient logged console.warn when the worker file
was not found, which is expected during tests (no build output).
The test setup treats unexpected warnings as failures.

Downgrade to logger.debug for the "not found" message and remove
the eager warning from resolveWorkerPath().
This commit is contained in:
Artem Rootman 2026-04-05 17:10:03 +00:00
parent e81116b85e
commit f2e1d0e944
No known key found for this signature in database
GPG key ID: B7C30676209A822C

View file

@ -43,7 +43,9 @@ function resolveWorkerPath(): string | null {
/* ignore */
}
}
logger.warn('team-data-worker not found in expected locations');
// Don't warn here — resolveWorkerPath runs at module load time and
// the worker file is expected to be absent during tests.
// isAvailable() warns once on first access instead.
return null;
}
@ -61,7 +63,7 @@ export class TeamDataWorkerClient {
isAvailable(): boolean {
if (!this.workerPath && !this.warnedUnavailable) {
this.warnedUnavailable = true;
logger.warn('team-data-worker not found; falling back to main-thread execution');
logger.debug('team-data-worker not found; falling back to main-thread execution');
}
return this.workerPath !== null;
}