diff --git a/package.json b/package.json index 83bdf52..3bdbff5 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "start": "node bin/server.js", "build": "node ace build", "dev": "node ace serve --hmr", - "test": "node ace test", + "test": "npx vitest run --coverage", "lint": "eslint .", "format": "prettier --write .", "typecheck": "tsc --noEmit", diff --git a/tests/integration/ttl_expiration.spec.ts b/tests/integration/ttl_expiration.spec.ts index 71aead3..59819e9 100644 --- a/tests/integration/ttl_expiration.spec.ts +++ b/tests/integration/ttl_expiration.spec.ts @@ -15,6 +15,11 @@ describe('TTL expiration integration test', () => { await client.connect() db = client.db('adam-acs-test') + // Ensure the collection exists before creating the index + const collections = await db.listCollections({ name: COLLECTION_NAME }).toArray() + if (collections.length === 0) { + await db.createCollection(COLLECTION_NAME) + } // Create the TTL index (as the migration would) const collection = db.collection(COLLECTION_NAME) await collection.createIndex(