Skip to content

Commit

Permalink
test: support testing aganst momento local by env var presence (#1378)
Browse files Browse the repository at this point in the history
To simplify testing against momento local, we use the momento local
credential provider when the `MOMENTO_LOCAL` environment variable
exists.
  • Loading branch information
malandis authored Jul 1, 2024
1 parent 5798d8c commit 63e8e08
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/client-sdk-nodejs/test/integration/integration-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,20 @@ function sessionCredsProvider(): CredentialProvider {
return _sessionCredsProvider;
}

function testAgainstMomentoLocal(): boolean {
return process.env.MOMENTO_LOCAL !== undefined;
}

export function integrationTestCacheClientProps(): CacheClientPropsWithConfig {
let credentialProvider = credsProvider();
if (testAgainstMomentoLocal()) {
credentialProvider = credentialProvider.withMomentoLocal();
}

return {
configuration:
Configurations.Laptop.latest().withClientTimeoutMillis(90000),
credentialProvider: credsProvider(),
credentialProvider,
defaultTtlSeconds: 1111,
};
}
Expand Down

0 comments on commit 63e8e08

Please sign in to comment.