@@ -2,7 +2,7 @@ import { beforeEach, describe, it, mock } from 'node:test';
22import assert from 'assert' ;
33import { NoSuchKey , S3 , S3ServiceException } from '@aws-sdk/client-s3' ;
44
5- import { getAmplifyClientsConfiguration } from './get_amplify_clients_configuration.js' ;
5+ import { internalGetAmplifyClientConfiguration } from './get_amplify_clients_configuration.js' ;
66
77const validEnv = {
88 AMPLIFY_DATA_MODEL_INTROSPECTION_SCHEMA_BUCKET_NAME :
@@ -18,7 +18,7 @@ const validEnv = {
1818
1919let mockS3Client : S3 ;
2020
21- void describe ( 'getAmplifyClientsConfiguration ' , ( ) => {
21+ void describe ( 'internalGetAmplifyClientConfiguration ' , ( ) => {
2222 beforeEach ( ( ) => {
2323 mockS3Client = new S3 ( ) ;
2424 } ) ;
@@ -27,7 +27,7 @@ void describe('getAmplifyClientsConfiguration', () => {
2727 void it ( `returns empty config objects when ${ envFieldToExclude } is not included` , async ( ) => {
2828 const env = { ...validEnv } as Record < string , string > ;
2929 delete env [ envFieldToExclude ] ;
30- assert . deepEqual ( await getAmplifyClientsConfiguration ( env ) , {
30+ assert . deepEqual ( await internalGetAmplifyClientConfiguration ( env ) , {
3131 resourceConfig : { } ,
3232 libraryOptions : { } ,
3333 } ) ;
@@ -36,7 +36,7 @@ void describe('getAmplifyClientsConfiguration', () => {
3636 void it ( `returns empty config objects when ${ envFieldToExclude } is not a string` , async ( ) => {
3737 const env = { ...validEnv } as Record < string , unknown > ;
3838 env [ envFieldToExclude ] = 123 ;
39- assert . deepEqual ( await getAmplifyClientsConfiguration ( env ) , {
39+ assert . deepEqual ( await internalGetAmplifyClientConfiguration ( env ) , {
4040 resourceConfig : { } ,
4141 libraryOptions : { } ,
4242 } ) ;
@@ -50,7 +50,8 @@ void describe('getAmplifyClientsConfiguration', () => {
5050 mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
5151
5252 await assert . rejects (
53- async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
53+ async ( ) =>
54+ await internalGetAmplifyClientConfiguration ( validEnv , mockS3Client ) ,
5455 new Error (
5556 'Error retrieving the schema from S3. Please confirm that your project has a `defineData` included in the `defineBackend` definition.'
5657 )
@@ -69,7 +70,8 @@ void describe('getAmplifyClientsConfiguration', () => {
6970 mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
7071
7172 await assert . rejects (
72- async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
73+ async ( ) =>
74+ await internalGetAmplifyClientConfiguration ( validEnv , mockS3Client ) ,
7375 new Error (
7476 'Error retrieving the schema from S3. You may need to grant this function authorization on the schema. TEST_ERROR: TEST_MESSAGE.'
7577 )
@@ -83,7 +85,8 @@ void describe('getAmplifyClientsConfiguration', () => {
8385 mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
8486
8587 await assert . rejects (
86- async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
88+ async ( ) =>
89+ await internalGetAmplifyClientConfiguration ( validEnv , mockS3Client ) ,
8790 new Error ( 'Test Error' )
8891 ) ;
8992 } ) ;
@@ -99,7 +102,7 @@ void describe('getAmplifyClientsConfiguration', () => {
99102 mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
100103
101104 const { resourceConfig, libraryOptions } =
102- await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ;
105+ await internalGetAmplifyClientConfiguration ( validEnv , mockS3Client ) ;
103106
104107 assert . deepEqual (
105108 await libraryOptions . Auth . credentialsProvider . getCredentialsAndIdentityId ?.( ) ,
0 commit comments