fix(build): align TypeScript and test imports with NodeNext builds and safely copy Uint8Array inputs in browser processing

This commit is contained in:
2026-05-01 16:10:01 +00:00
parent aa976061b1
commit c4dc34cd1a
14 changed files with 2811 additions and 4447 deletions
+7 -1
View File
@@ -1,5 +1,5 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as smartpreview from '../ts/index.ts';
import * as smartpreview from '../ts/index.js';
// Test data - minimal PDF buffer for testing
const createMinimalPdf = (): Buffer => {
@@ -105,6 +105,9 @@ tap.test('should throw error when not initialized', async () => {
expect(true).toEqual(false); // Should not reach here
} catch (error) {
expect(error).toBeInstanceOf(smartpreview.PreviewError);
if (!(error instanceof smartpreview.PreviewError)) {
throw error;
}
expect(error.errorType).toEqual('PROCESSING_FAILED');
}
});
@@ -117,6 +120,9 @@ tap.test('should validate input buffer', async () => {
expect(true).toEqual(false); // Should not reach here
} catch (error) {
expect(error).toBeInstanceOf(smartpreview.PreviewError);
if (!(error instanceof smartpreview.PreviewError)) {
throw error;
}
expect(error.errorType).toEqual('PROCESSING_FAILED');
}
});