Skip to content

Commit

Permalink
Adds x-pack to Jest integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley committed Aug 12, 2021
1 parent 3c41b3f commit 75ee7b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
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

0 comments on commit 75ee7b4

Please sign in to comment.