9288f56649
The PostRepository type was using `any` (an anti pattern) rather than `PostCollection`, and we had optional properties, which are not really optional. This cleans up the types and updates the tests alongside them.
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
export const posts = [{
|
|
id: 'post-1',
|
|
url: 'http://localhost:2368/post-1/',
|
|
title: 'Post 1',
|
|
slug: 'post-1',
|
|
tags: [],
|
|
featured: false,
|
|
created_at: new Date('2023-03-15T07:19:07.447Z'),
|
|
updated_at: new Date('2023-03-15T07:19:07.447Z'),
|
|
published_at: new Date('2023-03-15T07:19:07.447Z')
|
|
}, {
|
|
id: 'post-2',
|
|
url: 'http://localhost:2368/post-2/',
|
|
title: 'Post 2',
|
|
slug: 'post-2',
|
|
tags: [],
|
|
featured: false,
|
|
created_at: new Date('2023-04-05T07:20:07.447Z'),
|
|
updated_at: new Date('2023-04-05T07:20:07.447Z'),
|
|
published_at: new Date('2023-04-05T07:20:07.447Z')
|
|
}, {
|
|
id: 'post-3-featured',
|
|
url: 'http://localhost:2368/featured-post-3/',
|
|
title: 'Featured Post 3',
|
|
slug: 'featured-post-3',
|
|
tags: [],
|
|
featured: true,
|
|
created_at: new Date('2023-05-25T07:21:07.447Z'),
|
|
updated_at: new Date('2023-05-25T07:21:07.447Z'),
|
|
published_at: new Date('2023-05-25T07:21:07.447Z')
|
|
}, {
|
|
id: 'post-4-featured',
|
|
url: 'http://localhost:2368/featured-post-4/',
|
|
title: 'Featured Post 4',
|
|
slug: 'featured-post-4',
|
|
tags: [],
|
|
featured: true,
|
|
created_at: new Date('2023-05-15T07:21:07.447Z'),
|
|
updated_at: new Date('2023-05-15T07:21:07.447Z'),
|
|
published_at: new Date('2023-05-15T07:21:07.447Z')
|
|
}];
|