Update save-results.test.js

This commit is contained in:
Aleksandr Statciuk 2022-02-07 08:41:05 +03:00
parent 822e39dcf0
commit f56ea1e44e
1 changed files with 5 additions and 5 deletions

View File

@ -3,21 +3,21 @@ const path = require('path')
const { execSync } = require('child_process')
beforeEach(() => {
fs.emptyDirSync('tests/__data__/temp')
fs.emptyDirSync('tests/__data__/output')
fs.copyFileSync(
'tests/__data__/input/database/save-results.streams.db',
'tests/__data__/temp/streams.db'
'tests/__data__/output/streams.db'
)
const stdout = execSync(
'DB_DIR=tests/__data__/temp LOGS_DIR=tests/__data__/input/logs/load-cluster node scripts/commands/save-results.js',
'DB_DIR=tests/__data__/output LOGS_DIR=tests/__data__/input/logs/load-cluster node scripts/commands/save-results.js',
{ encoding: 'utf8' }
)
})
it('can save results', () => {
expect(content('tests/__data__/temp/streams.db')).toEqual(
content('tests/__data__/expected/save-results.streams.db')
expect(content('tests/__data__/output/streams.db')).toEqual(
content('tests/__data__/expected/database/save-results.streams.db')
)
})