mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: update unit tests
This commit is contained in:
parent
cf7af41ee1
commit
f559454049
@ -45,6 +45,23 @@ describe('flatten', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should support object with flattened keys', () => {
|
||||||
|
const object = {
|
||||||
|
'user.name': {
|
||||||
|
id: 'Alice',
|
||||||
|
},
|
||||||
|
nested: {
|
||||||
|
'country.name': 'France',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const result = flatten(object);
|
||||||
|
|
||||||
|
expect(result).toStrictEqual({
|
||||||
|
'nested.country.name': 'France',
|
||||||
|
'user.name.id': 'Alice',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should support custom prefix', () => {
|
it('should support custom prefix', () => {
|
||||||
const object = {
|
const object = {
|
||||||
isoCode: 'tun',
|
isoCode: 'tun',
|
||||||
|
Loading…
Reference in New Issue
Block a user