Skip to content

Commit 6ecfa03

Browse files
weaviate
1 parent 8d4c199 commit 6ecfa03

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

docs/modules/weaviate.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# Weaviate Module
2-
3-
[Weaviate](https://weaviate.io) is an open source, AI-native vector database that helps
4-
developers create intuitive and reliable AI-powered applications.
1+
# Weaviate
52

63
## Install
74

@@ -11,12 +8,22 @@ npm install @testcontainers/weaviate --save-dev
118

129
## Examples
1310

11+
These examples use the following libraries:
12+
13+
- [weaviate-ts-client](https://www.npmjs.com/package/weaviate-ts-client)
14+
15+
npm install weaviate-ts-client
16+
17+
Choose an image from the [container registry](https://hub.docker.com/r/semitechnologies/weaviate) and substitute `IMAGE`.
18+
19+
### Connect
20+
1421
<!--codeinclude-->
15-
[Connect to Weaviate:](../../packages/modules/weaviate/src/weaviate-container.test.ts)
16-
inside_block:connectWeaviateWithClient
22+
[](../../packages/modules/weaviate/src/weaviate-container.test.ts) inside_block:connectWeaviateWithClient
1723
<!--/codeinclude-->
1824

25+
### With modules
26+
1927
<!--codeinclude-->
20-
[Connect to Weaviate with modules defined:](../../packages/modules/weaviate/src/weaviate-container.test.ts)
21-
inside_block:connectWeaviateWithModules
28+
[](../../packages/modules/weaviate/src/weaviate-container.test.ts) inside_block:connectWeaviateWithModules
2229
<!--/codeinclude-->

packages/modules/weaviate/src/weaviate-container.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import { WeaviateContainer } from "./weaviate-container";
66
const IMAGE = getImage(__dirname);
77

88
describe("WeaviateContainer", { timeout: 100_000 }, () => {
9-
// connectWeaviate {
109
it("should expose ports", async () => {
10+
// connectWeaviate {
1111
await using container = await new WeaviateContainer(IMAGE).start();
1212

1313
expect(container.getHttpHostAddress()).toBeDefined();
1414
expect(container.getGrpcHostAddress()).toBeDefined();
15+
// }
1516
});
16-
// }
1717

18-
// connectWeaviateWithClient {
1918
it("should connect to Weaviate", async () => {
19+
// connectWeaviateWithClient {
2020
await using container = await new WeaviateContainer(IMAGE).start();
2121

2222
const client = weaviate.client({
@@ -26,11 +26,11 @@ describe("WeaviateContainer", { timeout: 100_000 }, () => {
2626

2727
const res = await client.misc.metaGetter().do();
2828
expect(res.version).toBeDefined();
29+
// }
2930
});
30-
// }
3131

32-
// connectWeaviateWithModules {
3332
it("should connect to Weaviate with modules", async () => {
33+
// connectWeaviateWithModules {
3434
const enableModules = [
3535
"backup-filesystem",
3636
"text2vec-openai",
@@ -42,6 +42,7 @@ describe("WeaviateContainer", { timeout: 100_000 }, () => {
4242
ENABLE_MODULES: enableModules.join(","),
4343
BACKUP_FILESYSTEM_PATH: "/tmp/backups",
4444
};
45+
4546
await using container = await new WeaviateContainer(IMAGE).withEnvironment(environment).start();
4647

4748
const client = weaviate.client({
@@ -52,9 +53,7 @@ describe("WeaviateContainer", { timeout: 100_000 }, () => {
5253
const res = await client.misc.metaGetter().do();
5354
expect(res.version).toBeDefined();
5455
expect(res.modules).toBeDefined();
55-
enableModules.forEach((module) => {
56-
expect(res.modules[module]).toBeDefined();
57-
});
56+
enableModules.forEach((module) => expect(res.modules[module]).toBeDefined());
57+
// }
5858
});
59-
// }
6059
});

0 commit comments

Comments
 (0)