mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Updating test to use new url function
This commit is contained in:
parent
4597be781e
commit
d6f90caa18
1 changed files with 9 additions and 5 deletions
|
@ -1,11 +1,13 @@
|
||||||
const { parser, url, request } = require('./pickx.be.config.js')
|
const { parser, url, request, fetchApiVersion, apiVersion } = require('./pickx.be.config.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
|
|
||||||
const date = dayjs.utc('2023-12-13').startOf('d')
|
const date = dayjs.utc('2023-12-13').startOf('d')
|
||||||
const channel = {
|
const channel = {
|
||||||
lang: 'fr',
|
lang: 'fr',
|
||||||
|
@ -13,10 +15,12 @@ const channel = {
|
||||||
xmltv_id: 'Vedia.be'
|
xmltv_id: 'Vedia.be'
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', async () => {
|
||||||
expect(url({channel, date}))
|
await fetchApiVersion();
|
||||||
.toBe('https://px-epg.azureedge.net/airings/11702375189765v.4.2/2023-12-13/channel/UID0118?timezone=Europe%2FBrussels')
|
const generatedUrl = await url({ channel, date });
|
||||||
})
|
const resolvedApiVersion = apiVersion();
|
||||||
|
expect(generatedUrl).toBe(`https://px-epg.azureedge.net/airings/${resolvedApiVersion}/2023-12-13/channel/UID0118?timezone=Europe%2FBrussels`);
|
||||||
|
});
|
||||||
|
|
||||||
it('can generate valid request headers', () => {
|
it('can generate valid request headers', () => {
|
||||||
expect(request.headers).toMatchObject({
|
expect(request.headers).toMatchObject({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue