Update tests
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
const { execSync } = require('child_process')
|
||||
import * as fs from 'fs-extra'
|
||||
import * as path from 'path'
|
||||
import { execSync } from 'child_process'
|
||||
import * as _ from 'lodash'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.mkdirSync('tests/__data__/output/database')
|
||||
|
||||
const stdout = execSync(
|
||||
'DB_DIR=tests/__data__/output/database DATA_DIR=tests/__data__/input/data npm run db:create -- --input-dir=tests/__data__/input/streams',
|
||||
'DB_DIR=tests/__data__/output/database DATA_DIR=tests/__data__/input/data STREAMS_DIR=tests/__data__/input/streams npm run db:create',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
})
|
||||
@@ -25,10 +26,12 @@ it('can create database', () => {
|
||||
return i
|
||||
})
|
||||
|
||||
expect(output).toMatchObject(expect.arrayContaining(expected))
|
||||
expect(_.orderBy(output, 'name')).toMatchObject(
|
||||
expect.arrayContaining(_.orderBy(expected, 'name'))
|
||||
)
|
||||
})
|
||||
|
||||
function content(filepath) {
|
||||
function content(filepath: string) {
|
||||
const data = fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
Reference in New Issue
Block a user