- Removed deprecated functions related to document parsing and blob storage in blobstore.ts. - Introduced new PDF rendering logic in pdf-preview-renderer.ts and pdf-preview-pdfjs-runtime.ts. - Updated previews-render.ts to utilize the new PDF rendering functions. - Refactored user-whisper-align-job.ts to use the compute-worker client for alignment requests. - Enhanced artifact.ts and operation.ts to validate parsed PDF artifacts and resolve current PDF parses. - Updated snapshot.ts to align with new worker operation types. - Adjusted runtime-config.ts to check for compute-worker availability. - Modified types in parsed-pdf.ts and tts.ts to reflect changes in the compute-worker protocol. - Added unit tests for PDF artifact validation and compute-worker client contract. - Removed obsolete pdf-op-key.vitest.spec.ts test file.
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
if (!process.env.AUTH_SECRET?.trim()) {
|
|
process.env.AUTH_SECRET = 'vitest-auth-secret';
|
|
}
|
|
|
|
if (!/^https?:\/\//.test(process.env.BASE_URL ?? '')) {
|
|
process.env.BASE_URL = 'http://localhost:3003';
|
|
}
|
|
|
|
const srcDir = fileURLToPath(new URL('./src/', import.meta.url));
|
|
const alias = [
|
|
{ find: /^@\//, replacement: `${srcDir}` },
|
|
{ find: '@', replacement: srcDir },
|
|
];
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias,
|
|
},
|
|
test: {
|
|
alias,
|
|
reporters: process.env.CI ? ['default', 'github-actions'] : ['default'],
|
|
projects: [
|
|
{
|
|
resolve: {
|
|
alias,
|
|
},
|
|
test: {
|
|
name: 'openreader',
|
|
environment: 'node',
|
|
include: ['tests/unit/**/*.vitest.spec.ts'],
|
|
setupFiles: ['tests/unit/setup-env.ts'],
|
|
},
|
|
},
|
|
{
|
|
test: {
|
|
name: 'compute-worker',
|
|
environment: 'node',
|
|
include: ['compute-worker/tests/{unit,api,compute}/**/*.test.ts'],
|
|
setupFiles: ['compute-worker/tests/setup-env.ts'],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|