// Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; import { HashMap, Struct } from '.'; const registry = new TypeRegistry(); describe('HashMap', (): void => { it('generates sane toRawTypes', (): void => { expect(new (HashMap.with(Text, U32))(registry).toRawType()).toBe('HashMap'); expect(new (HashMap.with(Text, Text))(registry).toRawType()).toBe('HashMap'); expect(new (HashMap.with(Text, Struct.with({ a: U32, b: Text })))(registry).toRawType()) .toBe('HashMap'); }); });