aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/users.ts
blob: 6cf61d60e0ff0963719c656d604eb9c4ec1412ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as request from 'supertest'
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'

// FIXME: delete once videos does not use it anymore
function xxxgetMyUserInformation (url: string, accessToken: string, specialStatus = HttpStatusCode.OK_200) {
  const path = '/api/v1/users/me'

  return request(url)
          .get(path)
          .set('Accept', 'application/json')
          .set('Authorization', 'Bearer ' + accessToken)
          .expect(specialStatus)
          .expect('Content-Type', /json/)
}

// ---------------------------------------------------------------------------

export {
  xxxgetMyUserInformation
}