odin-default-js-exercises/11_getTheTitles/solution/getTheTitles-solution.spec.js

19 lines
329 B
JavaScript
Raw Normal View History

2023-02-01 23:53:54 +00:00
const getTheTitles = require('./getTheTitles-solution');
2022-02-20 19:07:44 +00:00
2023-02-01 23:53:54 +00:00
describe('getTheTitles', () => {
2023-01-21 17:53:41 +00:00
const books = [
{
2023-02-01 23:53:54 +00:00
title: 'Book',
author: 'Name',
2023-01-21 17:53:41 +00:00
},
{
2023-02-01 23:53:54 +00:00
title: 'Book2',
author: 'Name2',
2023-01-21 17:53:41 +00:00
},
];
2022-02-20 19:07:44 +00:00
2023-02-01 23:53:54 +00:00
test('gets titles', () => {
expect(getTheTitles(books)).toEqual(['Book', 'Book2']);
2023-01-21 17:53:41 +00:00
});
2022-02-20 19:07:44 +00:00
});