Skip to content

Commit

Permalink
Add test for making a non-generic collection with no properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmith023 committed May 24, 2024
1 parent ea914a8 commit 3e7a067
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/collections/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ describe('Testing of the collections.create method', () => {
await contextionary.collections.delete(collectionName);
});

it('should be able to create a simple collection without a generic and no properties', async () => {
const collectionName = 'TestCollectionSimpleNonGeneric';
const response = await contextionary.collections
.create({
name: collectionName,
})
.then(() => contextionary.collections.get(collectionName).config.get());
expect(response.name).toEqual(collectionName);
expect(response.properties?.length).toEqual(0);
expect(response.vectorizers.default.indexConfig).toBeDefined();
expect(response.vectorizers.default.indexType).toEqual('hnsw');
expect(response.vectorizers.default.vectorizer.name).toEqual('text2vec-contextionary');

await contextionary.collections.delete(collectionName);
});

it('should be able to create a simple collection without a generic using a schema var', async () => {
const collectionName = 'TestCollectionSimpleNonGenericVar';
const schema = {
Expand Down

0 comments on commit 3e7a067

Please sign in to comment.