Skip to content

Commit

Permalink
[jest] Fix snapshot caused by environment (#118114)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Nov 10, 2021
1 parent ad1e2ad commit 92ffb9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/kbn-cli-dev-mode/src/dev_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ beforeEach(() => {
jest.clearAllMocks();
log.messages.length = 0;
process.execArgv = ['--inheritted', '--exec', '--argv'];
process.env.FORCE_COLOR = process.env.FORCE_COLOR || '1';
currentProc = undefined;
});

Expand Down Expand Up @@ -117,13 +118,10 @@ afterEach(() => {
subscriptions.length = 0;
});

describe.skip('#run$', () => {
describe('#run$', () => {
it('starts the dev server with the right options', () => {
run(new DevServer(defaultOptions)).unsubscribe();

// ensure that FORCE_COLOR is in the env for consistency in snapshot
process.env.FORCE_COLOR = process.env.FORCE_COLOR || 'true';

expect(execa.node.mock.calls).toMatchInlineSnapshot(`
Array [
Array [
Expand All @@ -136,6 +134,7 @@ describe.skip('#run$', () => {
"env": Object {
"<inheritted process.env>": true,
"ELASTIC_APM_SERVICE_NAME": "kibana",
"FORCE_COLOR": "true",
"isDevCliChild": "true",
},
"nodeOptions": Array [
Expand Down

0 comments on commit 92ffb9e

Please sign in to comment.