mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Move test functions outside extra-utils
This commit is contained in:
parent
bf54587a3e
commit
c55e3d7227
202 changed files with 798 additions and 895 deletions
|
@ -1,48 +0,0 @@
|
|||
import { HttpStatusCode } from '@shared/models'
|
||||
import { makeGetRequest } from './requests'
|
||||
|
||||
function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
token,
|
||||
query: { ...query, start: 'hello' },
|
||||
expectedStatus: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
||||
async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
|
||||
await makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
token,
|
||||
query: { ...query, count: 'hello' },
|
||||
expectedStatus: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
|
||||
await makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
token,
|
||||
query: { ...query, count: 2000 },
|
||||
expectedStatus: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
||||
function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
token,
|
||||
query: { ...query, sort: 'hello' },
|
||||
expectedStatus: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
checkBadStartPagination,
|
||||
checkBadCountPagination,
|
||||
checkBadSortPagination
|
||||
}
|
|
@ -1,3 +1 @@
|
|||
// Don't include activitypub that import stuff from server
|
||||
export * from './check-api-params'
|
||||
export * from './requests'
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
import { decode } from 'querystring'
|
||||
import request from 'supertest'
|
||||
import { URL } from 'url'
|
||||
import { buildAbsoluteFixturePath } from '@shared/core-utils'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
import { buildAbsoluteFixturePath } from '../miscs/tests'
|
||||
|
||||
export type CommonRequestParams = {
|
||||
url: string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue