More robust test
This commit is contained in:
parent
5a05c14573
commit
261dac403a
|
@ -148,8 +148,6 @@ describe('Test users with multiple servers', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Should search through account videos', async function () {
|
it('Should search through account videos', async function () {
|
||||||
this.timeout(10_000)
|
|
||||||
|
|
||||||
const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } })
|
const created = await servers[0].videos.upload({ token: userAccessToken, attributes: { name: 'Kami no chikara' } })
|
||||||
|
|
||||||
await waitJobs(servers)
|
await waitJobs(servers)
|
||||||
|
|
|
@ -14,7 +14,7 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
|
||||||
withRetry?: boolean // default false
|
withRetry?: boolean // default false
|
||||||
currentRetry?: number
|
currentRetry?: number
|
||||||
}): Promise<string> {
|
}): Promise<string> {
|
||||||
const { videoFileToken, reinjectVideoFileToken, withRetry = false, currentRetry = 1 } = options
|
const { videoFileToken, reinjectVideoFileToken, expectedStatus, withRetry = false, currentRetry = 1 } = options
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await unwrapTextOrDecode(this.getRawRequest({
|
const result = await unwrapTextOrDecode(this.getRawRequest({
|
||||||
|
@ -29,6 +29,11 @@ export class StreamingPlaylistsCommand extends AbstractCommand {
|
||||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
// master.m3u8 could be empty
|
||||||
|
if (!result && (!expectedStatus || expectedStatus === HttpStatusCode.OK_200)) {
|
||||||
|
throw new Error('Empty result')
|
||||||
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!withRetry || currentRetry > 10) throw err
|
if (!withRetry || currentRetry > 10) throw err
|
||||||
|
|
Loading…
Reference in New Issue