Skip to content

Context7 Platform -- Up-to-date docs for AI agents

update test library for redirection (#2751)

Enes Gules8bcad1372fb2
diff --git a/packages/sdk/src/client.test.ts b/packages/sdk/src/client.test.ts
index 24f9c50f..d17ddfd5 100644
--- a/packages/sdk/src/client.test.ts
+++ b/packages/sdk/src/client.test.ts
@@ -77,7 +77,7 @@ describe("Context7 Client", () => {
const client = new Context7({ apiKey });
test("should get context as Documentation array (default)", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react");
+ const result = await client.getContext("How to use hooks", "/react/react");
expect(result).toBeDefined();
expect(Array.isArray(result)).toBe(true);
@@ -85,7 +85,7 @@ describe("Context7 Client", () => {
});
test("should get context with explicit json type", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react", {
+ const result = await client.getContext("How to use hooks", "/react/react", {
type: "json",
});
@@ -95,7 +95,7 @@ describe("Context7 Client", () => {
});
test("should have correct Documentation structure", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react", {
+ const result = await client.getContext("How to use hooks", "/react/react", {
type: "json",
});
@@ -114,7 +114,7 @@ describe("Context7 Client", () => {
const client = new Context7({ apiKey });
test("should get context as text string with type: txt", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react", {
+ const result = await client.getContext("How to use hooks", "/react/react", {
type: "txt",
});
@@ -160,7 +160,7 @@ describe("Context7 Client", () => {
const client = new Context7({ apiKey });
test("should infer Documentation[] for default (json) format", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react");
+ const result = await client.getContext("How to use hooks", "/react/react");
expect(Array.isArray(result)).toBe(true);
expect(result[0]).toHaveProperty("title");
@@ -169,7 +169,7 @@ describe("Context7 Client", () => {
});
test("should infer string type for txt format", async () => {
- const result = await client.getContext("How to use hooks", "/facebook/react", {
+ const result = await client.getContext("How to use hooks", "/react/react", {
type: "txt",
});
diff --git a/packages/sdk/src/client.ts b/packages/sdk/src/client.ts
index 39a0f439..e5c76654 100644
--- a/packages/sdk/src/client.ts
+++ b/packages/sdk/src/client.ts
@@ -117,7 +117,7 @@ export class Context7 {
/**
* Get documentation context for a library
* @param query The user's question or task
- * @param libraryId Context7 library ID (e.g., "/facebook/react")
+ * @param libraryId Context7 library ID (e.g., "/react/react")
* @param options Response format options
* @returns Documentation as Documentation[] (json, default) or string (txt)
*/
diff --git a/packages/sdk/src/commands/get-context/index.test.ts b/packages/sdk/src/commands/get-context/index.test.ts
index 397645b1..ee5b0c6a 100644
--- a/packages/sdk/src/commands/get-context/index.test.ts
+++ b/packages/sdk/src/commands/get-context/index.test.ts
@@ -8,7 +8,7 @@ const httpClient = newHttpClient();
describe("GetContextCommand", () => {
test("should get library context as JSON (default)", async () => {
- const command = new GetContextCommand("How to use hooks", "/facebook/react");
+ const command = new GetContextCommand("How to use hooks", "/react/react");
const result = await command.exec(httpClient);
expect(result).toBeDefined();
@@ -24,7 +24,7 @@ describe("GetContextCommand", () => {
});
test("should get library context as text with type: txt", async () => {
- const command = new GetContextCommand("How to use hooks", "/facebook/react", {
+ const command = new GetContextCommand("How to use hooks", "/react/react", {
type: "txt",
});
const result = await command.exec(httpClient);
@@ -39,7 +39,7 @@ describe("GetContextCommand", () => {
apiKey: process.env.CONTEXT7_API_KEY || process.env.API_KEY!,
});
- const result = await client.getContext("How to use hooks", "/facebook/react");
+ const result = await client.getContext("How to use hooks", "/react/react");
expect(result).toBeDefined();
expect(Array.isArray(result)).toBe(true);
@@ -56,7 +56,7 @@ describe("GetContextCommand", () => {
apiKey: process.env.CONTEXT7_API_KEY || process.env.API_KEY!,
});
- const result = await client.getContext("How to use hooks", "/facebook/react", {
+ const result = await client.getContext("How to use hooks", "/react/react", {
type: "txt",
});
diff --git a/packages/sdk/src/commands/types.ts b/packages/sdk/src/commands/types.ts
index 156a03ba..607e3e2e 100644
--- a/packages/sdk/src/commands/types.ts
+++ b/packages/sdk/src/commands/types.ts
@@ -6,7 +6,7 @@ export interface Context7Config {
* A library available in Context7
*/
export interface Library {
- /** Context7 library ID (e.g., "/facebook/react") */
+ /** Context7 library ID (e.g., "/react/react") */
id: string;
/** Library display name */
name: string;