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 7438840
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 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,18 @@ 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 7438840

Please sign in to comment.