Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds x-pack to Jest integration tests #93331

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jest.config.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@
module.exports = {
preset: '@kbn/test/jest_integration',
rootDir: '.',
roots: ['<rootDir>/src', '<rootDir>/packages'],
roots: ['<rootDir>/src', '<rootDir>/packages', '<rootDir>/x-pack'],
testPathIgnorePatterns: [
'<rootDir>/x-pack/test/',

// https://github.com/elastic/kibana/issues/108440
'<rootDir>/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('GET /internal/global_search/searchable_types', () => {

it('calls the handler context with correct parameters', async () => {
await supertest(httpSetup.server.listener)
.post('/internal/global_search/searchable_types')
.get('/internal/global_search/searchable_types')
.expect(200);

expect(globalSearchHandlerContext.getSearchableTypes).toHaveBeenCalledTimes(1);
Expand All @@ -55,7 +55,7 @@ describe('GET /internal/global_search/searchable_types', () => {
globalSearchHandlerContext.getSearchableTypes.mockResolvedValue(['type-a', 'type-b']);

const response = await supertest(httpSetup.server.listener)
.post('/internal/global_search/searchable_types')
.get('/internal/global_search/searchable_types')
.expect(200);

expect(response.body).toEqual({
Expand All @@ -67,8 +67,8 @@ describe('GET /internal/global_search/searchable_types', () => {
globalSearchHandlerContext.getSearchableTypes.mockRejectedValue(new Error());

const response = await supertest(httpSetup.server.listener)
.post('/internal/global_search/searchable_types')
.expect(200);
.get('/internal/global_search/searchable_types')
.expect(500);

expect(response.body).toEqual(
expect.objectContaining({
Expand Down