Skip to content

Commit c48a278

Browse files
committed
test: add named vector test case
1 parent 295035f commit c48a278

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

src/collections/integration.test.ts

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -657,21 +657,41 @@ describe('Testing of the collections.create method', () => {
657657
).toEqual(true);
658658
});
659659

660-
requireAtLeast(1, 32, 0).it('should be able to create a collection with uncompressed vectors', async () => {
661-
const collectionName = 'TestCollectionUncompressedVector';
660+
requireAtLeast(1, 32, 0).describe('uncompressed vectors', () => {
661+
it('should be able to create a collection with uncompressed default vector', async () => {
662+
const collectionName = 'TestCollectionUncompressedVector';
662663

663-
await contextionary.collections.create({
664-
name: collectionName,
665-
vectorizers: weaviate.configure.vectors.text2VecContextionary({
666-
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
667-
quantizer: weaviate.configure.vectorIndex.quantizer.none(),
664+
await contextionary.collections.create({
665+
name: collectionName,
666+
vectorizers: weaviate.configure.vectors.text2VecContextionary({
667+
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
668+
quantizer: weaviate.configure.vectorIndex.quantizer.none(),
669+
}),
668670
}),
669-
}),
671+
});
672+
673+
const collection = await contextionary.collections.export(collectionName);
674+
675+
expect((collection.vectorizers.default.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined();
670676
});
671677

672-
const collection = await contextionary.collections.export(collectionName);
678+
it('should be able to create a collection with uncompressed named vector', async () => {
679+
const collectionName = 'TestCollectionUncompressedVectorNamed';
673680

674-
expect((collection.vectorizers.default.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined();
681+
await contextionary.collections.create({
682+
name: collectionName,
683+
vectorizers: weaviate.configure.vectors.text2VecContextionary({
684+
name: 'custom_vec',
685+
vectorIndexConfig: weaviate.configure.vectorIndex.hnsw({
686+
quantizer: weaviate.configure.vectorIndex.quantizer.none(),
687+
}),
688+
}),
689+
});
690+
691+
const collection = await contextionary.collections.export(collectionName);
692+
693+
expect((collection.vectorizers['custom_vec'].indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined();
694+
});
675695
});
676696

677697
it('should be able to create a collection with an openai vectorizer with configure.vectors', async () => {

0 commit comments

Comments
 (0)