mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Rename files
This commit is contained in:
26
ts/test-node/util/isRecord_test.std.ts
Normal file
26
ts/test-node/util/isRecord_test.std.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.std.js';
|
||||
|
||||
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