Skip to content

Commit

Permalink
spliting env keys
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsideguide committed Feb 27, 2024
1 parent 71852f0 commit 60fee12
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 57 deletions.
6 changes: 3 additions & 3 deletions src/__tests__/providers/Confluence/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ test(
provider: "confluence",
});

if (!process.env.NANGO_CONNECTION_ID_TEST) {
if (!process.env.NANGO_CONFLUENCE_CONNECTION_ID_TEST) {
throw new Error(
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
"Please specify the NANGO_CONFLUENCE_CONNECTION_ID_TEST environment variable."
);
}

await confluenceDataConnector.authorizeNango({
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
nango_connection_id: process.env.NANGO_CONFLUENCE_CONNECTION_ID_TEST,
});

const pages = await confluenceDataConnector.getDocuments();
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/providers/GitHub/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ test(
provider: "github",
});

if (!process.env.NANGO_CONNECTION_ID_TEST) {
if (!process.env.NANGO_GITHUB_CONNECTION_ID_TEST) {
throw new Error(
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
"Please specify the NANGO_GITHUB_CONNECTION_ID_TEST environment variable."
);
}

await githubDataConnector.authorizeNango({
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
nango_connection_id: process.env.NANGO_GITHUB_CONNECTION_ID_TEST,
});

// Test the format of returned documents
Expand Down
5 changes: 4 additions & 1 deletion src/__tests__/providers/GoogleDrive/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ test(
});

await googleDriveDataConnector.setOptions({
filesIds:['1zGA5Kxy_itvUDnSAC9PAlK_yb5oB6OJt']
filesIds:[]
})
const documents = await googleDriveDataConnector.getDocuments();
for (const doc of documents) {
console.log({doc})
}

expect(documents.length).toBeGreaterThan(0);
expect(documents[0].content).not.toBe(null);
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/providers/Jira/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ test(
provider: "jira",
});

if (!process.env.NANGO_CONNECTION_ID_TEST) {
if (!process.env.NANGO_JIRA_CONNECTION_ID_TEST) {
throw new Error(
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
"Please specify the NANGO_JIRA_CONNECTION_ID_TEST environment variable."
);
}

await jiraDataConnector.authorizeNango({
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
nango_connection_id: process.env.NANGO_JIRA_CONNECTION_ID_TEST,
});

const issues = await jiraDataConnector.getDocuments();
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/providers/Notion/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ test(
provider: "notion",
});

if (!process.env.NANGO_CONNECTION_ID_TEST) {
if (!process.env.NANGO_NOTION_CONNECTION_ID_TEST) {
throw new Error(
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
"Please specify the NANGO_NOTION_CONNECTION_ID_TEST environment variable."
);
}

await notionDataConnector.authorizeNango({
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
nango_connection_id: process.env.NANGO_NOTION_CONNECTION_ID_TEST,
});

const pages = await notionDataConnector.getDocuments();
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/providers/Salesforce/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ test(
provider: "salesforce",
});

if (!process.env.NANGO_CONNECTION_ID_TEST) {
if (!process.env.NANGO_SALESFORCE_CONNECTION_ID_TEST) {
throw new Error(
"Please specify the NANGO_CONNECTION_ID_TEST environment variable."
"Please specify the NANGO_SALESFORCE_CONNECTION_ID_TEST environment variable."
);
}

await salesforceDataConnector.authorizeNango({
nango_connection_id: process.env.NANGO_CONNECTION_ID_TEST,
nango_connection_id: process.env.NANGO_SALESFORCE_CONNECTION_ID_TEST,
});

salesforceDataConnector.setOptions({ mode: "accounts" });
Expand Down
41 changes: 0 additions & 41 deletions src/__tests__/providers/YouTube/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,45 +33,4 @@ describe("YouTubeDataProvider", () => {
);
expect(documents[0].content.toLowerCase()).toContain("say");
});

it(
"should return transcription from multiple youtube videos from a specific channel",
async () => {
const urls = ["https://www.youtube.com/@sideguide1530"];

const youtubeDataConnector = createDataConnector({
provider: "youtube",
});

await youtubeDataConnector.setOptions({ urls, isChannel: true });

const documents = await youtubeDataConnector.getDocuments();
expect(documents).not.toBe(null);
expect(documents.length).toBeGreaterThan(0);
expect(documents[0].content).not.toBe(null);
expect(documents[0].content.length).toBeGreaterThan(0);

expect(documents).toContainEqual({
content: expect.stringContaining(
"hi everybody my name is eric and i'm one"
),
metadata: {
sourceURL: "https://www.youtube.com/watch?v=DagdM1jPlpo",
},
provider: "youtube",
type: "text",
});
expect(documents).toContainEqual({
content: expect.stringContaining(
"stop watching youtube tutorials to learn"
),
metadata: {
sourceURL: "https://www.youtube.com/watch?v=LlHyUuJ7fN4",
},
provider: "youtube",
type: "text",
});
},
10 * 1000
); // 10 seconds
});

0 comments on commit 60fee12

Please sign in to comment.