Skip to content

Commit

Permalink
[test] Comment out Jest hooks in skipped blocks
Browse files Browse the repository at this point in the history
Jest will run the hooks regardless of if they are skipped.

Tests skipped in
elastic@61c9dc4
and
elastic@420ded8
were still resulting in build failures due to the beforeEach failing.

jestjs/jest#8379

Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley committed Mar 2, 2020
1 parent b7c8e3a commit 9c5b700
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ function createXPackRoot(config: {} = {}) {
describe('ingestManager', () => {
describe.skip('default. manager, EPM, and Fleet all disabled', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeAll(async () => {
root = createXPackRoot();
await root.setup();
Expand All @@ -33,6 +39,8 @@ describe('ingestManager', () => {
afterAll(async () => await root.shutdown());
*/

it('does not have agent config api', async () => {
await kbnTestServer.request.get(root, '/api/ingest_manager/agent_configs').expect(404);
});
Expand All @@ -52,6 +60,12 @@ describe('ingestManager', () => {

describe.skip('manager only (no EPM, no Fleet)', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand All @@ -65,6 +79,8 @@ describe('ingestManager', () => {
afterAll(async () => await root.shutdown());
*/

it('has agent config api', async () => {
await kbnTestServer.request.get(root, '/api/ingest_manager/agent_configs').expect(200);
});
Expand All @@ -89,6 +105,12 @@ describe('ingestManager', () => {

describe.skip('manager and EPM; no Fleet', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand All @@ -103,6 +125,8 @@ describe('ingestManager', () => {
afterAll(async () => await root.shutdown());
*/

it('has agent config api', async () => {
await kbnTestServer.request.get(root, '/api/ingest_manager/agent_configs').expect(200);
});
Expand Down

0 comments on commit 9c5b700

Please sign in to comment.