@@ -2,10 +2,7 @@ import { beforeEach, describe, it, mock } from 'node:test';
2
2
import assert from 'assert' ;
3
3
import { NoSuchKey , S3 , S3ServiceException } from '@aws-sdk/client-s3' ;
4
4
5
- import {
6
- getAmplifyClientsConfiguration ,
7
- getAmplifyClientsConfigurationRetriever ,
8
- } from './get_amplify_clients_configuration.js' ;
5
+ import { getAmplifyClientsConfiguration } from './get_amplify_clients_configuration.js' ;
9
6
10
7
const validEnv = {
11
8
AMPLIFY_DATA_MODEL_INTROSPECTION_SCHEMA_BUCKET_NAME :
@@ -53,8 +50,7 @@ void describe('getAmplifyClientsConfiguration', () => {
53
50
mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
54
51
55
52
await assert . rejects (
56
- async ( ) =>
57
- await getAmplifyClientsConfigurationRetriever ( validEnv , mockS3Client ) ,
53
+ async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
58
54
new Error (
59
55
'Error retrieving the schema from S3. Please confirm that your project has a `defineData` included in the `defineBackend` definition.'
60
56
)
@@ -73,8 +69,7 @@ void describe('getAmplifyClientsConfiguration', () => {
73
69
mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
74
70
75
71
await assert . rejects (
76
- async ( ) =>
77
- await getAmplifyClientsConfigurationRetriever ( validEnv , mockS3Client ) ,
72
+ async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
78
73
new Error (
79
74
'Error retrieving the schema from S3. You may need to grant this function authorization on the schema. TEST_ERROR: TEST_MESSAGE.'
80
75
)
@@ -88,8 +83,7 @@ void describe('getAmplifyClientsConfiguration', () => {
88
83
mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
89
84
90
85
await assert . rejects (
91
- async ( ) =>
92
- await getAmplifyClientsConfigurationRetriever ( validEnv , mockS3Client ) ,
86
+ async ( ) => await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ,
93
87
new Error ( 'Test Error' )
94
88
) ;
95
89
} ) ;
@@ -105,7 +99,7 @@ void describe('getAmplifyClientsConfiguration', () => {
105
99
mock . method ( mockS3Client , 'send' , s3ClientSendMock ) ;
106
100
107
101
const { resourceConfig, libraryOptions } =
108
- await getAmplifyClientsConfigurationRetriever ( validEnv , mockS3Client ) ;
102
+ await getAmplifyClientsConfiguration ( validEnv , mockS3Client ) ;
109
103
110
104
assert . deepEqual (
111
105
await libraryOptions . Auth . credentialsProvider . getCredentialsAndIdentityId ?.( ) ,
0 commit comments