Update tests

This commit is contained in:
freearhey
2025-12-04 18:32:06 +03:00
parent 963e4a88c4
commit a27ba0c7d0

View File

@@ -3,20 +3,20 @@ import { execSync } from 'child_process'
import fs from 'fs-extra' import fs from 'fs-extra'
const ENV_VAR = const ENV_VAR =
'cross-env DATA_DIR=tests/__data__/input/data STREAMS_DIR=tests/__data__/input/api_generate API_DIR=tests/__data__/output/.api' 'cross-env DATA_DIR=tests/__data__/input/data STREAMS_DIR=tests/__data__/input/playlist_export API_DIR=tests/__data__/output/.api'
beforeEach(() => { beforeEach(() => {
fs.emptyDirSync('tests/__data__/output') fs.emptyDirSync('tests/__data__/output')
}) })
describe('api:generate', () => { describe('playlist:export', () => {
it('can create streams.json', () => { it('can create streams.json', () => {
const cmd = `${ENV_VAR} npm run api:generate` const cmd = `${ENV_VAR} npm run playlist:export`
const stdout = execSync(cmd, { encoding: 'utf8' }) const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout) if (process.env.DEBUG === 'true') console.log(cmd, stdout)
expect(content('tests/__data__/output/.api/streams.json')).toMatchObject( expect(content('tests/__data__/output/.api/streams.json')).toMatchObject(
content('tests/__data__/expected/api_generate/.api/streams.json') content('tests/__data__/expected/playlist_export/.api/streams.json')
) )
}) })
}) })