Update update-database.test.js

This commit is contained in:
Aleksandr Statciuk 2021-12-14 09:59:28 +03:00
parent 385b087ac0
commit cc7fd8387e
1 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@ const { execSync } = require('child_process')
beforeEach(() => {
fs.rmdirSync('tests/__data__/temp', { recursive: true })
fs.mkdirSync('tests/__data__/temp')
fs.copyFileSync('tests/__data__/input/test.db', 'tests/__data__/temp/test.db')
fs.copyFileSync('tests/__data__/input/update.db', 'tests/__data__/temp/test.db')
})
it('can update database', () => {
@ -94,4 +94,16 @@ it('can update database', () => {
updated: true,
cluster_id: 1
})
expect(JSON.parse(lines[4])).toMatchObject({
id: 'KayhanTV.af',
status: { label: 'Timeout', code: 'timeout', level: 4 },
is_broken: true,
updated: true
})
expect(JSON.parse(lines[5])).toMatchObject({
id: 'Sharq.af',
status: { label: 'Offline', code: 'offline', level: 5 },
is_broken: true,
updated: true
})
})