aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/videos/services.ts
blob: 1a53dd4cf56b8412f208eef35e7da2d7558c69f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as request from 'supertest'

function getOEmbed (url: string, oembedUrl: string, format?: string, maxHeight?: number, maxWidth?: number) {
  const path = '/services/oembed'
  const query = {
    url: oembedUrl,
    format,
    maxheight: maxHeight,
    maxwidth: maxWidth
  }

  return request(url)
          .get(path)
          .query(query)
          .set('Accept', 'application/json')
          .expect(200)
}

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

export {
  getOEmbed
}