mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-26 13:20:48 +00:00
Show additional data in debug log header
This commit is contained in:
26
ts/test-both/util/isRecord_test.ts
Normal file
26
ts/test-both/util/isRecord_test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isRecord } from '../../util/isRecord';
|
||||
|
||||
describe('isRecord', () => {
|
||||
it('returns false for primitives', () => {
|
||||
['hello', 123, BigInt(123), true, undefined, Symbol('test'), null].forEach(
|
||||
value => {
|
||||
assert.isFalse(isRecord(value));
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('returns false for arrays', () => {
|
||||
assert.isFalse(isRecord([]));
|
||||
});
|
||||
|
||||
it('returns true for "plain" objects', () => {
|
||||
assert.isTrue(isRecord({}));
|
||||
assert.isTrue(isRecord({ foo: 'bar' }));
|
||||
assert.isTrue(isRecord(Object.create(null)));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user