Test happy path

This commit is contained in:
Adria Navarro 2023-05-17 09:38:59 +02:00
parent 896bc61934
commit 6b2e6f7bcb
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import { ElasticsearchContainer } from "testcontainers"
import elastic from "../../../../packages/server/src/integrations/elasticsearch"
jest.unmock("@elastic/elasticsearch")
describe("datasource validators", () => {
describe("elastic search", () => {
let url: string
beforeAll(async () => {
const container = await new ElasticsearchContainer().start()
url = container.getHttpUrl()
})
it("test valid connection string", async () => {
const integration = new elastic.integration({
url,
})
const result = await integration.testConnection()
expect(result).toEqual({ connected: true })
})
})
})