freakin test

This commit is contained in:
Kylart 2017-11-18 13:14:43 +01:00
parent 72c8384245
commit f8509f8b17
1 changed files with 17 additions and 12 deletions

View File

@ -128,19 +128,24 @@ test('/getLatest.json exits and returns 18 elements with right keys at 720p', as
test('/download Mahou Shoujo Ikusei Keikaku with HorribleSubs at 720p on nyaa.pantsu.cat exits and returns' + test('/download Mahou Shoujo Ikusei Keikaku with HorribleSubs at 720p on nyaa.pantsu.cat exits and returns' +
' all magnets', async t => { ' all magnets', async t => {
const { data, status } = await axios.post(`${uri}/download`, { try {
name: 'Mahou Shoujo Ikusei Keikaku', const { data, status } = await axios.post(`${uri}/download`, {
quality: '720p', name: 'Mahou Shoujo Ikusei Keikaku',
fromEp: 0, quality: '720p',
untilEp: 20000, fromEp: 0,
fansub: 'HorribleSubs', untilEp: 20000,
choice: 'pantsu' fansub: 'HorribleSubs',
}) choice: 'pantsu'
})
if (status === 200) { if (status === 200) {
t.is(data.magnets.length, 12) t.is(data.magnets.length, 12)
t.not(data.magnets[0], '') t.not(data.magnets[0], '')
} else { } else {
t.is(status, 204)
}
} catch (e) {
console.info(e)
t.fail() t.fail()
} }
}) })