mirror of
https://github.com/iptv-org/epg
synced 2026-04-28 13:37:01 -04:00
Replaced LF endings with CRLF
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
const { parser } = require('./moji.id.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2023-08-18', 'YYYY-MM-DD').startOf('d')
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const results = parser({ content: '' })
|
||||
expect(results).toMatchObject([])
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
|
||||
const results = parser({ content, date }).map(p => {
|
||||
p.start = p.start.year(2023).toJSON()
|
||||
p.stop = p.stop.year(2023).toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
title: 'TRUST',
|
||||
start: '2023-08-17T17:00:00.000Z',
|
||||
stop: '2023-08-17T17:30:00.000Z',
|
||||
description: 'Informasi seputar menjaga vitalitas pria'
|
||||
})
|
||||
})
|
||||
const { parser } = require('./moji.id.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2023-08-18', 'YYYY-MM-DD').startOf('d')
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const results = parser({ content: '' })
|
||||
expect(results).toMatchObject([])
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
|
||||
const results = parser({ content, date }).map(p => {
|
||||
p.start = p.start.year(2023).toJSON()
|
||||
p.stop = p.stop.year(2023).toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
title: 'TRUST',
|
||||
start: '2023-08-17T17:00:00.000Z',
|
||||
stop: '2023-08-17T17:30:00.000Z',
|
||||
description: 'Informasi seputar menjaga vitalitas pria'
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user