mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 02:20:03 -04:00
Update tests/commands
This commit is contained in:
parent
0b2ab738e8
commit
2b84b126c9
5 changed files with 61 additions and 17 deletions
|
@ -4,9 +4,10 @@ const { execSync } = require('child_process')
|
|||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.mkdirSync('tests/__data__/output/database')
|
||||
|
||||
const stdout = execSync(
|
||||
'DB_DIR=tests/__data__/output/database npm run db:create -- --input-dir=tests/__data__/input/streams --max-clusters=1',
|
||||
'DB_DIR=tests/__data__/output/database DATA_DIR=tests/__data__/input/data npm run db:create -- --input-dir=tests/__data__/input/streams --max-clusters=1',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
})
|
||||
|
@ -24,14 +25,7 @@ it('can create database', () => {
|
|||
return i
|
||||
})
|
||||
|
||||
expect(output).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining(expected[0]),
|
||||
expect.objectContaining(expected[1]),
|
||||
expect.objectContaining(expected[2]),
|
||||
expect.objectContaining(expected[3])
|
||||
])
|
||||
)
|
||||
expect(output).toMatchObject(expect.arrayContaining(expected))
|
||||
})
|
||||
|
||||
function content(filepath) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue