Skip to content

Commit 1d62717

Browse files
committed
Add back tests of unsupported error throwing for <1.25
1 parent 0abc234 commit 1d62717

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/collections/tenants/integration.test.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,34 @@ describe('Testing of the collection.tenants methods', () => {
8484

8585
describe('getByName and getByNames', () => {
8686
it('should be able to get a tenant by name string', async () => {
87-
const result = await collection.tenants.getByName('hot');
87+
const query = () => collection.tenants.getByName('hot');
88+
if (await client.getWeaviateVersion().then((ver) => ver.isLowerThan(1, 25, 0))) {
89+
await expect(query()).rejects.toThrow(WeaviateUnsupportedFeatureError);
90+
return;
91+
}
92+
const result = await query();
8893
expect(result).toHaveProperty('name', 'hot');
8994
expect(result).toHaveProperty('activityStatus', 'ACTIVE');
9095
});
9196

9297
it('should be able to get a tenant by tenant object', async () => {
93-
const result = await collection.tenants.getByName({ name: 'hot' });
98+
const query = () => collection.tenants.getByName({ name: 'hot' });
99+
if (await client.getWeaviateVersion().then((ver) => ver.isLowerThan(1, 25, 0))) {
100+
await expect(query()).rejects.toThrow(WeaviateUnsupportedFeatureError);
101+
return;
102+
}
103+
const result = await query();
94104
expect(result).toHaveProperty('name', 'hot');
95105
expect(result).toHaveProperty('activityStatus', 'ACTIVE');
96106
});
97107

98108
it('should fail to get a non-existing tenant', async () => {
99-
const result = await collection.tenants.getByName('non-existing');
109+
const query = () => collection.tenants.getByName('non-existing');
110+
if (await client.getWeaviateVersion().then((ver) => ver.isLowerThan(1, 25, 0))) {
111+
await expect(query()).rejects.toThrow(WeaviateUnsupportedFeatureError);
112+
return;
113+
}
114+
const result = await query();
100115
expect(result).toBeNull();
101116
});
102117

0 commit comments

Comments
 (0)