2022-02-07 04:11:40 +01:00
|
|
|
const fs = require('fs-extra')
|
2021-12-12 05:13:02 +01:00
|
|
|
const path = require('path')
|
|
|
|
const { execSync } = require('child_process')
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2022-02-07 04:11:40 +01:00
|
|
|
fs.emptyDirSync('tests/__data__/temp')
|
2021-12-12 05:13:02 +01:00
|
|
|
|
2022-02-07 04:11:40 +01:00
|
|
|
fs.copyFileSync('tests/__data__/input/database/streams.db', 'tests/__data__/temp/streams.db')
|
2021-12-12 05:13:02 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it('can create valid matrix', () => {
|
2022-02-07 04:11:40 +01:00
|
|
|
const result = execSync('DB_DIR=tests/__data__/temp node scripts/commands/create-matrix.js', {
|
|
|
|
encoding: 'utf8'
|
|
|
|
})
|
2021-12-12 05:13:02 +01:00
|
|
|
expect(result).toBe('::set-output name=matrix::{"cluster_id":[1,3]}\n')
|
|
|
|
})
|