mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 19:13:14 -04:00
## Summary While working on #188737 I had to move `supertestWithoutAuth` into `kbn-ftr-common-functional-services` package. This change seems to be bigger than initially planned. Moving it to the separate PR with following changes: - move FTR `SupertestWithoutAuthProvider` service to package - remove "duplicates" in favour of service from package - update service type where needed
19 lines
723 B
TypeScript
19 lines
723 B
TypeScript
/*
|
|
* 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 { format as formatUrl } from 'url';
|
|
import supertest from 'supertest';
|
|
import { FtrProviderContext } from '../../functional/ftr_provider_context';
|
|
/**
|
|
* Returns supertest.SuperTest<supertest.Test> instance that will not persist cookie between API requests.
|
|
*/
|
|
export function SupertestProvider({ getService }: FtrProviderContext) {
|
|
const config = getService('config');
|
|
const kbnUrl = formatUrl(config.get('servers.kibana'));
|
|
|
|
return supertest(kbnUrl);
|
|
}
|