1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/utils/object.test.ts

32 lines
466 B
TypeScript
Raw Normal View History

import { objectValueFromPath } from './object';
describe('object', () => {
test.each([
[
{
note: {
id: '123',
title: 'my note',
},
},
'note.title',
'my note',
],
[
{
note: {
id: '123',
title: 'my note',
},
},
'note.doesntexist',
undefined,
],
])('should extract URLs', (object, path, expected) => {
const actual = objectValueFromPath(object, path);
expect(actual).toBe(expected);
});
});