diff --git a/src/utils/index.test.ts b/src/utils/index.test.ts new file mode 100644 index 00000000..57a41101 --- /dev/null +++ b/src/utils/index.test.ts @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2020 The Pybricks Authors + +import { hex } from '.'; + +test('hex', () => { + expect(hex(0, 2)).toBe('0x00'); + expect(hex(1, 4)).toBe('0x0001'); + expect(hex(2, 8)).toBe('0x00000002'); +});