PeerTube/shared/extra-utils/users/users.ts

21 lines
658 B
TypeScript
Raw Normal View History

2017-09-04 21:21:47 +02:00
import * as request from 'supertest'
2021-05-07 11:53:46 +02:00
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
2017-10-27 17:27:06 +02:00
2021-07-13 14:23:01 +02:00
// FIXME: delete once videos does not use it anymore
function xxxgetMyUserInformation (url: string, accessToken: string, specialStatus = HttpStatusCode.OK_200) {
2017-09-04 21:21:47 +02:00
const path = '/api/v1/users/me'
return request(url)
.get(path)
.set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + accessToken)
2017-12-28 15:25:31 +01:00
.expect(specialStatus)
2017-09-04 21:21:47 +02:00
.expect('Content-Type', /json/)
}
// ---------------------------------------------------------------------------
export {
2021-07-13 14:23:01 +02:00
xxxgetMyUserInformation
2017-09-04 21:21:47 +02:00
}