mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 10:28:03 +01:00
More protobufjs use
This commit is contained in:
21
ts/test-both/util/normalizeNumber_test.ts
Normal file
21
ts/test-both/util/normalizeNumber_test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import Long from 'long';
|
||||
|
||||
import { normalizeNumber } from '../../util/normalizeNumber';
|
||||
|
||||
describe('normalizeNumber', () => {
|
||||
it('returns undefined when input is undefined', () => {
|
||||
assert.isUndefined(normalizeNumber(undefined));
|
||||
});
|
||||
|
||||
it('returns number when input is number', () => {
|
||||
assert.strictEqual(normalizeNumber(123), 123);
|
||||
});
|
||||
|
||||
it('returns number when input is Long', () => {
|
||||
assert.strictEqual(normalizeNumber(new Long(123)), 123);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user