Skip to content

Commit d09b587

Browse files
committed
Change to return object of descr/it instead of fn
1 parent a41049c commit d09b587

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

src/collections/config/integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ describe('Testing of the collection.config namespace', () => {
239239
expect(config.vectorizers.default.vectorizer.name).toEqual('none');
240240
});
241241

242-
requireAtLeast(1, 26, 0)(it)('should be able to get the config of a collection with hnsw-sq', async () => {
242+
requireAtLeast(1, 26, 0).it('should be able to get the config of a collection with hnsw-sq', async () => {
243243
const collectionName = 'TestCollectionConfigGetHNSWPlusSQ';
244244
const collection = await client.collections.create({
245245
name: collectionName,
@@ -418,7 +418,7 @@ describe('Testing of the collection.config namespace', () => {
418418
]);
419419
});
420420

421-
requireAtLeast(1, 31, 0)(describe)('Mutable named vectors', () => {
421+
requireAtLeast(1, 31, 0).describe('Mutable named vectors', () => {
422422
it('should be able to add named vectors to a collection', async () => {
423423
const collectionName = 'TestCollectionConfigAddVector' as const;
424424
const collection = await client.collections.create({

src/collections/query/integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('Testing of the collection.query methods with a simple collection', ()
134134
expect(ret.objects[0].uuid).toEqual(id);
135135
});
136136

137-
requireAtLeast(1, 31, 0)(describe)('bm25 search operator (minimum_should_match)', () => {
137+
requireAtLeast(1, 31, 0).describe('bm25 search operator (minimum_should_match)', () => {
138138
it('should query with bm25 + operator', async () => {
139139
const ret = await collection.query.bm25('carrot', {
140140
limit: 1,

src/roles/integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ const testCases: TestCase[] = [
279279
},
280280
];
281281

282-
requireAtLeast(1, 29, 0)(describe)('Integration testing of the roles namespace', () => {
282+
requireAtLeast(1, 29, 0).describe('Integration testing of the roles namespace', () => {
283283
let client: WeaviateClient;
284284

285285
beforeAll(async () => {
@@ -313,7 +313,7 @@ requireAtLeast(1, 29, 0)(describe)('Integration testing of the roles namespace',
313313
expect(exists).toBeFalsy();
314314
});
315315

316-
requireAtLeast(1, 30, 0)(describe)('namespaced users', () => {
316+
requireAtLeast(1, 30, 0).describe('namespaced users', () => {
317317
it('retrieves assigned users with/without namespace', async () => {
318318
await client.roles.create('landlord', {
319319
collection: 'Buildings',

src/users/integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { requireAtLeast } from '../../test/version.js';
33
import { WeaviateUserTypeDB } from '../openapi/types.js';
44
import { GetUserOptions, UserDB } from './types.js';
55

6-
requireAtLeast(1, 29, 0)(describe)('Integration testing of the users namespace', () => {
6+
requireAtLeast(1, 29, 0).describe('Integration testing of the users namespace', () => {
77
const makeClient = (key: string) =>
88
weaviate.connectToLocal({
99
port: 8091,
@@ -58,7 +58,7 @@ requireAtLeast(1, 29, 0)(describe)('Integration testing of the users namespace',
5858
expect(roles.test).toBeUndefined();
5959
});
6060

61-
requireAtLeast(1, 30, 0)(describe)('dynamic user management', () => {
61+
requireAtLeast(1, 30, 0).describe('dynamic user management', () => {
6262
/** List dynamic DB users. */
6363
const listDBUsers = (c: WeaviateClient, opts?: GetUserOptions) =>
6464
c.users.db.listAll(opts).then((all) => all.filter((u) => u.userType == 'db_user'));
@@ -164,7 +164,7 @@ requireAtLeast(1, 29, 0)(describe)('Integration testing of the users namespace',
164164
expect(roles.Permissioner.nodesPermissions).toHaveLength(1);
165165
});
166166

167-
requireAtLeast(1, 30, 1)(describe)('additional DUM features', () => {
167+
requireAtLeast(1, 30, 1).describe('additional DUM features', () => {
168168
it('should be able to fetch additional user info', async () => {
169169
const admin = await makeClient('admin-key');
170170
const timKey = await admin.users.db.create('timely-tim');

test/version.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { DbVersion } from '../src/utils/dbVersion';
33
const version = DbVersion.fromString(`v${process.env.WEAVIATE_VERSION!}`);
44

55
/** Run the suite / test only for Weaviate version above this. */
6-
export const requireAtLeast =
7-
(...semver: [...Parameters<DbVersion['isAtLeast']>]) =>
8-
(func: jest.Describe | jest.It) =>
9-
version.isAtLeast(...semver) ? func : func.skip;
6+
export const requireAtLeast = (...semver: [...Parameters<DbVersion['isAtLeast']>]) =>
7+
version.isAtLeast(...semver)
8+
? {
9+
describe,
10+
it,
11+
}
12+
: {
13+
describe: describe.skip,
14+
it: it.skip,
15+
};

0 commit comments

Comments
 (0)