-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7f4678
commit 3e11b0c
Showing
7 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const env = process.env.TEST_ENV || "prod" | ||
export const getTestConfig = ():Record<string,string> => { | ||
return require(`./test.config.${env}.json`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"COMPOSIO_API_KEY": "cq5ke4zt8e7a1lmen823", | ||
"BACKEND_HERMES_URL": "https://backend.composio.dev" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { describe, it, expect } from "@jest/globals"; | ||
import {Composio} from "./index" | ||
|
||
//@ts-ignore | ||
import { getTestConfig } from "../../config/getTestConfig"; | ||
|
||
const COMPOSIO_API_KEY = getTestConfig()["COMPOSIO_API_KEY"] | ||
const BACKEND_HERMES_URL = getTestConfig()["BACKEND_HERMES_URL"] | ||
|
||
describe("Basic SDK spec suite", () => { | ||
it("create basic client", () => { | ||
new Composio(COMPOSIO_API_KEY) | ||
}); | ||
|
||
it("without apiKey, error should be thrown", () => { | ||
expect(() => { | ||
new Composio(); | ||
}).toThrow('API key is missing'); | ||
}); | ||
|
||
it("get entity",async()=>{ | ||
const app = "github" | ||
const composio = new Composio(COMPOSIO_API_KEY, BACKEND_HERMES_URL); | ||
const entity = composio.getEntity("default") | ||
|
||
expect(entity.id).toBe("default") | ||
const connection = await entity.getConnection(app); | ||
expect(connection.appUniqueId).toBe(app); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters