mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Refactor requests
This commit is contained in:
parent
08642a765e
commit
c0e8b12e7f
230 changed files with 948 additions and 1064 deletions
|
@ -1,15 +1,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import 'mocha'
|
||||
|
||||
import {
|
||||
cleanupTests,
|
||||
createSingleServer,
|
||||
PeerTubeServer,
|
||||
setAccessTokensToServers
|
||||
} from '../../../../shared/extra-utils'
|
||||
import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
|
||||
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
|
||||
import { cleanupTests, createSingleServer, makeGetRequest, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
|
||||
describe('Test debug API validators', function () {
|
||||
const path = '/api/v1/server/debug'
|
||||
|
@ -39,7 +32,7 @@ describe('Test debug API validators', function () {
|
|||
await makeGetRequest({
|
||||
url: server.url,
|
||||
path,
|
||||
statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401
|
||||
expectedStatus: HttpStatusCode.UNAUTHORIZED_401
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -48,7 +41,7 @@ describe('Test debug API validators', function () {
|
|||
url: server.url,
|
||||
path,
|
||||
token: userAccessToken,
|
||||
statusCodeExpected: HttpStatusCode.FORBIDDEN_403
|
||||
expectedStatus: HttpStatusCode.FORBIDDEN_403
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -58,7 +51,7 @@ describe('Test debug API validators', function () {
|
|||
path,
|
||||
token: server.accessToken,
|
||||
query: { startDate: new Date().toISOString() },
|
||||
statusCodeExpected: HttpStatusCode.OK_200
|
||||
expectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue