Skip to content

Commit ae9c2e2

Browse files
committed
Use a variable for local integration test server
1 parent 1bbf695 commit ae9c2e2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/integration/SplitPdfHook.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@ import { UnstructuredClient } from "../../src";
44
import { PartitionResponse } from "../../src/sdk/models/operations";
55
import { PartitionParameters, Strategy } from "../../src/sdk/models/shared";
66

7+
const localServer = "http://localhost:8000"
8+
79
describe("SplitPdfHook integration tests check splitted file is same as not splitted", () => {
810
const FAKE_API_KEY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
911
const consoleInfoSpy = jest.spyOn(console, "info");
1012
const consoleWarnSpy = jest.spyOn(console, "warn");
1113
const consoleErrorSpy = jest.spyOn(console, "error");
1214

1315
let client = new UnstructuredClient({
14-
serverURL: "http://localhost:8000",
16+
serverURL: localServer,
1517
security: {
1618
apiKeyAuth: FAKE_API_KEY,
1719
},
1820
});
1921

2022
beforeEach(async () => {
2123
try {
22-
const res = await fetch("http://localhost:8000/general/docs");
24+
const res = await fetch(`${localServer}/general/docs`);
2325
expect(res.status).toEqual(200);
2426
} catch {
25-
throw Error("The unstructured-api is not running on localhost:8000");
27+
throw Error(`The unstructured-api is not running on ${localServer}`);
2628
}
2729

2830
client = new UnstructuredClient({
29-
serverURL: "http://localhost:8000",
31+
serverURL: localServer,
3032
security: {
3133
apiKeyAuth: FAKE_API_KEY,
3234
},

0 commit comments

Comments
 (0)