|
1 | 1 | import { customizationsFromModel } from './index';
|
2 | 2 | import { metadata } from '../../shapes.fixture';
|
3 |
| -import { TreeModel } from '@aws-sdk/build-types'; |
| 3 | +import { TreeModel, MiddlewareCustomizationDefinition } from '@aws-sdk/build-types'; |
4 | 4 |
|
5 | 5 | const model: TreeModel = {
|
6 | 6 | name: 'Foo Service',
|
@@ -65,9 +65,16 @@ describe('customizationsFromModel', () => {
|
65 | 65 | }
|
66 | 66 |
|
67 | 67 | it(`should return a property definition for user-agent header`, () => {
|
68 |
| - const {client} = customizationsFromModel(model, 'universal'); |
69 |
| - const [customization, ...rest] = client.reverse(); |
70 |
| - expect(client[0]).toHaveProperty('type'); |
71 |
| - expect(client[0].type).toBe('Middleware'); |
| 68 | + let {client} = customizationsFromModel(model, 'node'); |
| 69 | + let [customization, ...rest] = client.reverse(); |
| 70 | + expect(customization).toHaveProperty('type'); |
| 71 | + expect(customization.type).toBe('Middleware'); |
| 72 | + expect((customization as MiddlewareCustomizationDefinition).expression).toContain('\'User-Agent\':'); |
| 73 | + |
| 74 | + client = customizationsFromModel(model, 'browser').client; |
| 75 | + [customization, ...rest] = client.reverse(); |
| 76 | + expect(customization).toHaveProperty('type'); |
| 77 | + expect(customization.type).toBe('Middleware'); |
| 78 | + expect((customization as MiddlewareCustomizationDefinition).expression).toContain('\'X-Amz-User-Agent\':'); |
72 | 79 | });
|
73 | 80 | });
|
0 commit comments