Skip to content

Commit

Permalink
add back initial connection logic to fix tests in GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 20, 2025
1 parent 0a668f6 commit 51d7c06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/mongooseFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ export async function createMongooseCollections(useTables: boolean) {
}
}

before(async function connectMongooseFixtures() {
if (isAstra) {
// @ts-expect-error - these are config options supported by stargate-mongoose but not mongoose
await mongooseInstance.connect(testClient.uri, testClient.options);
} else {
await mongooseInstance.connect(testClient!.uri, testClient!.options);
const keyspace = parseUri(testClient!.uri).keyspaceName;
await mongooseInstance.connection.createNamespace(keyspace);
}
});

before(createMongooseCollections);

after(async function disconnectMongooseFixtures() {
await mongooseInstance.disconnect();
});

0 comments on commit 51d7c06

Please sign in to comment.