Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: fix env var restoration
  • Loading branch information
nbbeeken committed Mar 4, 2024
commit f97eb7b0ba31535e686094e4c293fe46c068d87f
10 changes: 6 additions & 4 deletions test/integration/auth/mongodb_aws.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ describe('MONGODB-AWS', function () {
});

describe('with missing aws token', () => {
let awsSessionToken;
let awsSessionToken: string | undefined;

beforeEach(function () {
beforeEach(() => {
awsSessionToken = process.env.AWS_SESSION_TOKEN;
delete process.env.AWS_SESSION_TOKEN;
});

afterEach(async () => {
process.env.AWS_SESSION_TOKEN = awsSessionToken;
afterEach(() => {
if (awsSessionToken != null) {
process.env.AWS_SESSION_TOKEN = awsSessionToken;
}
});

it('should not throw an exception when aws token is missing', async function () {
Expand Down