fix(build): align TypeScript and test imports with NodeNext builds and safely copy Uint8Array inputs in browser processing
This commit is contained in:
+7
-1
@@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user