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:
28
mocks/crawler.mock.js
Normal file
28
mocks/crawler.mock.js
Normal 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,
|
||||
}
|
Reference in New Issue
Block a user