Fix datasource.spec.ts tests.

This commit is contained in:
Sam Rose 2025-04-07 11:21:54 +01:00
parent bd4724f52a
commit 6fe993ad53
No known key found for this signature in database
1 changed files with 8 additions and 1 deletions

View File

@ -14,7 +14,11 @@ import {
} from "@budibase/types" } from "@budibase/types"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { getEnvironmentVariables } from "../../utils" import { getEnvironmentVariables } from "../../utils"
import { getDefinitions, getDefinition } from "../../../integrations" import {
getDefinitions,
getDefinition,
getIntegration,
} from "../../../integrations"
import merge from "lodash/merge" import merge from "lodash/merge"
import { import {
BudibaseInternalDB, BudibaseInternalDB,
@ -292,6 +296,9 @@ export async function save(
datasource: Datasource, datasource: Datasource,
opts?: { fetchSchema?: boolean; tablesFilter?: string[] } opts?: { fetchSchema?: boolean; tablesFilter?: string[] }
): Promise<{ datasource: Datasource; errors: Record<string, string> }> { ): Promise<{ datasource: Datasource; errors: Record<string, string> }> {
// getIntegration throws an error if the integration is not found
await getIntegration(datasource.source)
const db = context.getAppDB() const db = context.getAppDB()
const plus = datasource.plus const plus = datasource.plus