@@ -4,29 +4,31 @@ import { UnstructuredClient } from "../../src";
4
4
import { PartitionResponse } from "../../src/sdk/models/operations" ;
5
5
import { PartitionParameters , Strategy } from "../../src/sdk/models/shared" ;
6
6
7
+ const localServer = "http://localhost:8000"
8
+
7
9
describe ( "SplitPdfHook integration tests check splitted file is same as not splitted" , ( ) => {
8
10
const FAKE_API_KEY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ;
9
11
const consoleInfoSpy = jest . spyOn ( console , "info" ) ;
10
12
const consoleWarnSpy = jest . spyOn ( console , "warn" ) ;
11
13
const consoleErrorSpy = jest . spyOn ( console , "error" ) ;
12
14
13
15
let client = new UnstructuredClient ( {
14
- serverURL : "http://localhost:8000" ,
16
+ serverURL : localServer ,
15
17
security : {
16
18
apiKeyAuth : FAKE_API_KEY ,
17
19
} ,
18
20
} ) ;
19
21
20
22
beforeEach ( async ( ) => {
21
23
try {
22
- const res = await fetch ( "http://localhost:8000/ general/docs" ) ;
24
+ const res = await fetch ( ` ${ localServer } / general/docs` ) ;
23
25
expect ( res . status ) . toEqual ( 200 ) ;
24
26
} catch {
25
- throw Error ( " The unstructured-api is not running on localhost:8000" ) ;
27
+ throw Error ( ` The unstructured-api is not running on ${ localServer } ` ) ;
26
28
}
27
29
28
30
client = new UnstructuredClient ( {
29
- serverURL : "http://localhost:8000" ,
31
+ serverURL : localServer ,
30
32
security : {
31
33
apiKeyAuth : FAKE_API_KEY ,
32
34
} ,
0 commit comments