Fix tests
This commit is contained in:
@ -17,6 +17,7 @@ export const importCsv = async (ctx: ImportContext, stream: Stream) => {
|
||||
// labels follows format: "[label1, label2]"
|
||||
const labels = row.length > 2 ? row[2].slice(1, -1).split(',') : undefined
|
||||
await ctx.urlHandler(ctx, url, state, labels)
|
||||
ctx.countImported++
|
||||
} catch (error) {
|
||||
console.log('invalid url', row, error)
|
||||
ctx.countFailed += 1
|
||||
|
||||
@ -155,10 +155,12 @@ const urlHandler = async (
|
||||
state,
|
||||
labels
|
||||
)
|
||||
result ? ctx.countImported++ : ctx.countFailed++
|
||||
if (!result) {
|
||||
return Promise.reject('Failed to import url')
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('error importing url', err)
|
||||
ctx.countFailed += 1
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user