Update update.test.js

This commit is contained in:
Aleksandr Statciuk 2023-02-08 03:54:57 +03:00
parent ac859044a5
commit dc986a9d09

View file

@ -17,32 +17,6 @@ it('can generate /guides', () => {
{ encoding: 'utf8' } { encoding: 'utf8' }
) )
expect(stdout).toBe(
`
> guides:update
> NODE_OPTIONS=--max-old-space-size=5120 node scripts/commands/guides/update.js
starting...
loading data/channels.json...
loading database/programs.db...
found 6 programs
creating tests/__data__/output/guides/da/allente.se.xml...
creating tests/__data__/output/guides/da/allente.se.xml.gz...
creating tests/__data__/output/guides/da/allente.se.json...
creating tests/__data__/output/guides/en/virginmedia.com.xml...
creating tests/__data__/output/guides/en/virginmedia.com.xml.gz...
creating tests/__data__/output/guides/en/virginmedia.com.json...
creating tests/__data__/output/guides/fr/sky.com.xml...
creating tests/__data__/output/guides/fr/sky.com.xml.gz...
creating tests/__data__/output/guides/fr/sky.com.json...
creating tests/__data__/output/guides/en/sky.com.xml...
creating tests/__data__/output/guides/en/sky.com.xml.gz...
creating tests/__data__/output/guides/en/sky.com.json...
creating tests/__data__/output/logs/guides/update.log...
finished
`
)
const uncompressed = glob const uncompressed = glob
.sync('tests/__data__/expected/guides/**/*.xml') .sync('tests/__data__/expected/guides/**/*.xml')
.map(f => f.replace('tests/__data__/expected/', '')) .map(f => f.replace('tests/__data__/expected/', ''))
@ -59,14 +33,6 @@ finished
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`)) expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
}) })
const json = glob
.sync('tests/__data__/expected/guides/**/*.json')
.map(f => f.replace('tests/__data__/expected/', ''))
json.forEach(filepath => {
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
})
expect(content('output/logs/guides/update.log')).toEqual( expect(content('output/logs/guides/update.log')).toEqual(
content('expected/logs/guides/update.log') content('expected/logs/guides/update.log')
) )