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

19 lines
329 B
JavaScript
Raw Normal View History

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