Skip to content

Commit

Permalink
test: add one for mock environment that is now shared in 2 test files
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <naseem@transit.app>
  • Loading branch information
Naseem committed Jul 27, 2020
1 parent 8b313d5 commit 6aa975f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/opentelemetry-core/test/utils/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,17 @@ describe('environment', () => {
});
});
});

describe('mockEnvironment', () => {
it('should remove a mock environment', () => {
mockEnvironment({
OTEL_LOG_LEVEL: 'ERROR',
OTEL_SAMPLING_PROBABILITY: 0.5,
});
removeMockEnvironment();
const env = getEnv();
assert.strictEqual(env.OTEL_LOG_LEVEL, LogLevel.INFO);
assert.strictEqual(env.OTEL_SAMPLING_PROBABILITY, 1);
});
});
});

0 comments on commit 6aa975f

Please sign in to comment.