File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import {
1313 GetSecretValueCommand ,
1414 SecretsManagerClient ,
1515} from "@aws-sdk/client-secrets-manager" ;
16+ import { CloudFrontKeyValueStoreClient } from "@aws-sdk/client-cloudfront-keyvaluestore" ;
17+
1618import { secretJson , secretObject } from "./secret.testdata.js" ;
1719import supertest from "supertest" ;
1820
@@ -21,6 +23,16 @@ const smMock = mockClient(SecretsManagerClient);
2123const jwt_secret = secretObject [ "jwt_key" ] ;
2224vi . stubEnv ( "JwtSigningKey" , jwt_secret ) ;
2325
26+ // Mock the Cloudfront KV client to prevent the actual Cloudfront KV call
27+ // aws-sdk-client-mock doesn't support Cloudfront KV Client API
28+ vi . mock ( "../../src/api/functions/cloudfrontKvStore.js" , async ( ) => {
29+ return {
30+ setKey : vi . fn ( ) ,
31+ deleteKey : vi . fn ( ) ,
32+ getKey : vi . fn ( ) . mockResolvedValue ( "https://www.acm.illinois.edu" ) ,
33+ } ;
34+ } ) ;
35+
2436const app = await init ( ) ;
2537
2638( app as any ) . nodeCache . flushAll ( ) ;
You can’t perform that action at this time.
0 commit comments