fix(streams): tighten stream typings and guard optional runtime paths for duplex and wrapper utilities

This commit is contained in:
2026-04-30 12:04:51 +00:00
parent f78469a299
commit fccd0f86ad
19 changed files with 1687 additions and 4247 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
import { expect, tap } from '@push.rocks/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as fs from 'fs';
import { StreamWrapper, SmartDuplex } from '../ts/index.js';
@@ -27,7 +27,8 @@ tap.test('StreamWrapper: should propagate errors', async (tools) => {
await wrapper.run();
} catch (err) {
errorCaught = true;
expect(err.message).toEqual('intentional error');
const message = err instanceof Error ? err.message : String(err);
expect(message).toEqual('intentional error');
}
expect(errorCaught).toBeTrue();
});