iptv/tests/commands/create-matrix.test.js

17 lines
512 B
JavaScript
Raw Normal View History

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