Update tests

This commit is contained in:
freearhey committed 2025-03-29 11:39:30 +03:00
1 parent 3c46b2b3d0
commit 6d9ee99848
8 files changed
+49 -48

No files matched your search

+8 -6
View File
@@ -3,15 +3,17 @@ import fs from 'fs-extra'
beforeEach(() => {
fs.emptyDirSync('tests/__data__/output')
execSync(
'STREAMS_DIR=tests/__data__/input/streams_generate API_DIR=tests/__data__/output/.api npm run api:generate',
{ encoding: 'utf8' }
)
})
it('can create streams.json', () => {
expect(content('output/.api/streams.json')).toMatchObject(content('expected/.api/streams.json'))
execSync(
'DATA_DIR=tests/__data__/input/data STREAMS_DIR=tests/__data__/input/api_generate API_DIR=tests/__data__/output/.api npm run api:generate',
{ encoding: 'utf8' }
)
expect(content('output/.api/streams.json')).toMatchObject(
content('expected/api_generate/.api/streams.json')
)
})
function content(filepath: string) {