mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix tests
This commit is contained in:
parent
f4ff4b9fcd
commit
6d48816c22
2 changed files with 4 additions and 5 deletions
|
|
@ -43,7 +43,7 @@ type RssFeed = Parser.Output<{
|
|||
type RssFeedItemMedia = {
|
||||
$: { url: string; width?: string; height?: string; medium?: string }
|
||||
}
|
||||
type RssFeedItem = Item & {
|
||||
export type RssFeedItem = Item & {
|
||||
'media:thumbnail'?: RssFeedItemMedia
|
||||
'media:content'?: RssFeedItemMedia[]
|
||||
link: string
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
import { expect } from 'chai'
|
||||
import 'mocha'
|
||||
import { Item } from 'rss-parser'
|
||||
import { isOldItem } from '../src'
|
||||
import { isOldItem, RssFeedItem } from '../src'
|
||||
|
||||
describe('isOldItem', () => {
|
||||
it('returns true if item is older than 1 day', () => {
|
||||
const item = {
|
||||
pubDate: '2020-01-01',
|
||||
} as Item
|
||||
} as RssFeedItem
|
||||
const lastFetchedAt = Date.now()
|
||||
|
||||
expect(isOldItem(item, lastFetchedAt)).to.be.true
|
||||
|
|
@ -17,7 +16,7 @@ describe('isOldItem', () => {
|
|||
const lastFetchedAt = Date.now()
|
||||
const item = {
|
||||
pubDate: new Date(lastFetchedAt).toISOString(),
|
||||
} as Item
|
||||
} as RssFeedItem
|
||||
|
||||
expect(isOldItem(item, lastFetchedAt)).to.be.true
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue