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

21 lines
658 B
TypeScript
Raw Normal View History

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