From 29f252603630e3c19207e7f55efb6f8fa7d2b61c Mon Sep 17 00:00:00 2001 From: techiejd <62455039+techiejd@users.noreply.github.com> Date: Sat, 10 Jan 2026 16:06:33 +0700 Subject: [PATCH] Fixes failing test so we can publish --- dev/specs/failedValidation.spec.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/specs/failedValidation.spec.ts b/dev/specs/failedValidation.spec.ts index d1a86e3..5dd8084 100644 --- a/dev/specs/failedValidation.spec.ts +++ b/dev/specs/failedValidation.spec.ts @@ -4,7 +4,7 @@ import { getPayload } from 'payload' import { describe, expect, test } from 'vitest' import { createVectorizeIntegration } from '../../src/index.js' -import { waitForVectorizationJobs } from './utils.js' +import { createTestDb, waitForVectorizationJobs } from './utils.js' const DIMS = 8 @@ -18,8 +18,9 @@ const { afterSchemaInitHook, payloadcmsVectorize } = createVectorizeIntegration( }, }) -const buildMalformedConfig = async () => - buildConfig({ +const buildMalformedConfig = async () => { + await createTestDb({ dbName: 'failed_validation_test' }) + return buildConfig({ jobs: { tasks: [], autoRun: [ @@ -40,7 +41,8 @@ const buildMalformedConfig = async () => afterSchemaInit: [afterSchemaInitHook], pool: { connectionString: - process.env.DATABASE_URI || 'postgresql://postgres:password@localhost:5433/payload_test', + process.env.DATABASE_URI || + 'postgresql://postgres:password@localhost:5433/failed_validation_test', }, }), plugins: [ @@ -62,6 +64,7 @@ const buildMalformedConfig = async () => ], secret: 'failed-validation-secret', }) +} describe('Validation failures mark jobs as errored', () => { test('malformed chunk entry fails the vectorize job', async () => {