Show additional data in debug log header
This commit is contained in:
parent
03874a788f
commit
689542a9b4
14 changed files with 278 additions and 89 deletions
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)));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue