-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Expand file tree
/
Copy pathindex.ts
More file actions
54 lines (50 loc) · 1.72 KB
/
index.ts
File metadata and controls
54 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { ApiServicesFixture } from '@kbn/scout-oblt';
import { apiTest as baseApiTest } from '@kbn/scout-oblt';
import {
createSyntheticsPrivateLocationApi,
type SyntheticsPrivateLocationApi,
} from '../services/synthetics_private_location_api_service';
export type SyntheticsApiServicesFixture = ApiServicesFixture & {
syntheticsPrivateLocations: SyntheticsPrivateLocationApi;
};
/**
* Scout `apiTest` for synthetics API specs.
*
* Extends `apiServices` with `syntheticsPrivateLocations`, a worker-scoped
* helper that manages the synthetics Fleet package install and private-location
* saved objects. Use in `beforeAll`/`afterAll` for environment prep only —
* keep the HTTP call *under test* on `apiClient` with scoped credentials from
* `requestAuth` / `samlAuth`.
*/
export const apiTest = baseApiTest.extend<{}, { apiServices: SyntheticsApiServicesFixture }>({
apiServices: [
async ({ apiServices, kbnClient }, use) => {
const syntheticsPrivateLocations = createSyntheticsPrivateLocationApi(
kbnClient,
apiServices.fleet
);
const extended: SyntheticsApiServicesFixture = {
...apiServices,
syntheticsPrivateLocations,
};
await use(extended);
},
{ scope: 'worker' },
],
});
export {
KIBANA_HEADERS,
PUBLIC_API_HEADERS,
PUBLIC_API_VERSION,
INTERNAL_API_VERSION,
SYNTHETICS_API_URLS,
SYNTHETICS_MONITOR_SO_TYPES,
LOCAL_PUBLIC_LOCATION,
mergeSyntheticsApiHeaders,
} from './constants';