1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-06-05 22:09:25 +02:00

add specs for ICS retriever

This commit is contained in:
Ondřej Synáček
2020-07-16 16:37:20 +02:00
parent 8458ae0b69
commit 456eaa1fbc
3 changed files with 143 additions and 14 deletions

28
mocks/crawler.mock.js Normal file
View File

@ -0,0 +1,28 @@
let mockCrawlResult = null
const mockCrawl = (url, { logger }) => {
return mockCrawlResult
}
const setMockCrawlResult = (result) => {
mockCrawlResult = new Promise((resolve, reject) => {
resolve(result)
})
}
const setMockCrawlErrorResult = (error) => {
mockCrawlResult = new Promise((resolve, reject) => {
reject(error)
})
}
const clearMockCrawlResult = () => {
mockCrawlResult = null
}
module.exports = {
mockCrawl,
setMockCrawlResult,
setMockCrawlErrorResult,
clearMockCrawlResult,
}