|
1 |
| -import fs from 'fs'; |
2 |
| -import weaviate, { toBase64FromMedia } from '../src/'; |
| 1 | +// import fs from 'fs'; |
| 2 | +// import weaviate, { toBase64FromMedia } from '../src/'; |
3 | 3 |
|
4 |
| -describe('Journey testing of the image functionality', () => { |
5 |
| - const collectionName = 'ImageJourneyTesting'; |
| 4 | +// describe('Journey testing of the image functionality', () => { |
| 5 | +// const collectionName = 'ImageJourneyTesting'; |
6 | 6 |
|
7 |
| - beforeAll(async () => { |
8 |
| - const client = await weaviate.connectToLocal(); |
9 |
| - await client.collections.delete(collectionName); |
10 |
| - }); |
| 7 | +// beforeAll(async () => { |
| 8 | +// const client = await weaviate.connectToLocal(); |
| 9 | +// await client.collections.delete(collectionName); |
| 10 | +// }); |
11 | 11 |
|
12 |
| - it('should create a collection with an image property and capable vectorizer', async () => { |
13 |
| - const client = await weaviate.connectToLocal(); |
14 |
| - await client.collections.create({ |
15 |
| - name: collectionName, |
16 |
| - properties: [ |
17 |
| - { |
18 |
| - name: 'image', |
19 |
| - dataType: 'blob', |
20 |
| - }, |
21 |
| - ], |
22 |
| - vectorizers: weaviate.configure.vectorizer.img2VecNeural({ |
23 |
| - imageFields: ['image'], |
24 |
| - }), |
25 |
| - }); |
26 |
| - }); |
| 12 | +// it('should create a collection with an image property and capable vectorizer', async () => { |
| 13 | +// const client = await weaviate.connectToLocal(); |
| 14 | +// await client.collections.create({ |
| 15 | +// name: collectionName, |
| 16 | +// properties: [ |
| 17 | +// { |
| 18 | +// name: 'image', |
| 19 | +// dataType: 'blob', |
| 20 | +// }, |
| 21 | +// ], |
| 22 | +// vectorizers: weaviate.configure.vectorizer.img2VecNeural({ |
| 23 | +// imageFields: ['image'], |
| 24 | +// }), |
| 25 | +// }); |
| 26 | +// }); |
27 | 27 |
|
28 |
| - it('should insert an encoded image', async () => { |
29 |
| - const client = await weaviate.connectToLocal(); |
30 |
| - await client.collections.get(collectionName).data.insert({ |
31 |
| - image: await toBase64FromMedia('./public/favicon.ico'), |
32 |
| - }); |
33 |
| - }); |
| 28 | +// it('should insert an encoded image', async () => { |
| 29 | +// const client = await weaviate.connectToLocal(); |
| 30 | +// await client.collections.get(collectionName).data.insert({ |
| 31 | +// image: await toBase64FromMedia('./public/favicon.ico'), |
| 32 | +// }); |
| 33 | +// }); |
34 | 34 |
|
35 |
| - it('should retrieve the encoded image', async () => { |
36 |
| - const client = await weaviate.connectToLocal(); |
37 |
| - const res = await client.collections |
38 |
| - .get(collectionName) |
39 |
| - .query.fetchObjects({ returnProperties: ['image'] }); |
40 |
| - expect(res.objects[0].properties.image).toBeDefined(); |
41 |
| - }); |
| 35 | +// it('should retrieve the encoded image', async () => { |
| 36 | +// const client = await weaviate.connectToLocal(); |
| 37 | +// const res = await client.collections |
| 38 | +// .get(collectionName) |
| 39 | +// .query.fetchObjects({ returnProperties: ['image'] }); |
| 40 | +// expect(res.objects[0].properties.image).toBeDefined(); |
| 41 | +// }); |
42 | 42 |
|
43 |
| - it('should search on the encoded image vector with a file path string', async () => { |
44 |
| - const client = await weaviate.connectToLocal(); |
45 |
| - const res = await client.collections.get(collectionName).query.nearImage('./public/favicon.ico'); |
46 |
| - expect(res.objects.length).toEqual(1); |
47 |
| - }); |
| 43 | +// it('should search on the encoded image vector with a file path string', async () => { |
| 44 | +// const client = await weaviate.connectToLocal(); |
| 45 | +// const res = await client.collections.get(collectionName).query.nearImage('./public/favicon.ico'); |
| 46 | +// expect(res.objects.length).toEqual(1); |
| 47 | +// }); |
48 | 48 |
|
49 |
| - it('should search on the encoded image vector with a buffer', async () => { |
50 |
| - const client = await weaviate.connectToLocal(); |
51 |
| - const res = await client.collections |
52 |
| - .get(collectionName) |
53 |
| - .query.nearImage(fs.readFileSync('./public/favicon.ico')); // eslint-disable-line no-sync |
54 |
| - expect(res.objects.length).toEqual(1); |
55 |
| - }); |
56 |
| -}); |
| 49 | +// it('should search on the encoded image vector with a buffer', async () => { |
| 50 | +// const client = await weaviate.connectToLocal(); |
| 51 | +// const res = await client.collections |
| 52 | +// .get(collectionName) |
| 53 | +// .query.nearImage(fs.readFileSync('./public/favicon.ico')); // eslint-disable-line no-sync |
| 54 | +// expect(res.objects.length).toEqual(1); |
| 55 | +// }); |
| 56 | +// }); |
0 commit comments