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

32 lines
466 B
TypeScript

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);
});
});