diff --git a/packages/amplify-appsync-simulator/src/__tests__/velocity/value-mapper/map.test.ts b/packages/amplify-appsync-simulator/src/__tests__/velocity/value-mapper/map.test.ts index 6b566292e84..60e5fee115f 100644 --- a/packages/amplify-appsync-simulator/src/__tests__/velocity/value-mapper/map.test.ts +++ b/packages/amplify-appsync-simulator/src/__tests__/velocity/value-mapper/map.test.ts @@ -39,10 +39,7 @@ describe('JavaMap', () => { it('entrySet', () => { const obj = { foo: 'Foo Value', bar: 'Bar Value' }; const map = new JavaMap(obj, identityMapper); - expect(map.entrySet().toJSON()).toEqual([ - { key: 'foo', value: 'Foo Value' }, - { key: 'bar', value: 'Bar Value' }, - ]); + expect(map.entrySet().toJSON()).toEqual([{ key: 'foo', value: 'Foo Value' }, { key: 'bar', value: 'Bar Value' }]); }); it('equal', () => { @@ -74,7 +71,7 @@ describe('JavaMap', () => { it('keySet returns a JavaArray with each element of type JavaString', () => { const obj = { foo: 'Foo Value', bar: 'Bar Value' }; - const map = new JavaMap(obj, identityMapper); + const map = new JavaMap(obj, mapper); expect(map.keySet()).toEqual(new JavaArray([new JavaString('foo'), new JavaString('bar')], mapper)); }); diff --git a/packages/amplify-appsync-simulator/src/velocity/value-mapper/map.ts b/packages/amplify-appsync-simulator/src/velocity/value-mapper/map.ts index 5a2e7528759..184f91f0d36 100644 --- a/packages/amplify-appsync-simulator/src/velocity/value-mapper/map.ts +++ b/packages/amplify-appsync-simulator/src/velocity/value-mapper/map.ts @@ -1,6 +1,5 @@ import { JavaArray } from './array'; import { toJSON } from './to-json'; -import { map } from './mapper'; export class JavaMap { private map: Map; @@ -57,7 +56,7 @@ export class JavaMap { } keySet() { - return map(Array.from(this.map.keys())); + return new JavaArray(Array.from(this.map.keys()).map(this.mapper as any), this.mapper); } put(key, value) {