-
Notifications
You must be signed in to change notification settings - Fork 87
/
findProvider.spec.js
35 lines (30 loc) · 1.1 KB
/
findProvider.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import findProvider from './findProvider'
describe('Vimeo', () => {
it('matches `https://vimeo.com/showcase/2098620/video/4082288`', () => {
expect(findProvider('https://vimeo.com/showcase/2098620/video/4082288')).toEqual(
'https://vimeo.com/api/oembed.json',
)
})
})
describe('RiffReporter', () => {
it('matches `https://www.riffreporter.de/flugbegleiter-koralle/`', () => {
expect(findProvider('https://www.riffreporter.de/flugbegleiter-koralle/')).toEqual(
'https://www.riffreporter.de/service/oembed',
)
})
})
describe('Youtube', () => {
it('matches `https://www.youtube.com/watch?v=qkdXAtO40Fo`', () => {
expect(findProvider('https://www.youtube.com/watch?v=qkdXAtO40Fo')).toEqual(
'https://www.youtube.com/oembed',
)
})
it('matches `https://youtu.be/qkdXAtO40Fo`', () => {
expect(findProvider(`https://youtu.be/qkdXAtO40Fo`)).toEqual('https://www.youtube.com/oembed')
})
it('matches `https://youtu.be/qkdXAtO40Fo?t=41`', () => {
expect(findProvider(`https://youtu.be/qkdXAtO40Fo?t=41`)).toEqual(
'https://www.youtube.com/oembed',
)
})
})