mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 18:10:04 -04:00
Create tests
This commit is contained in:
parent
42d8a670d2
commit
9bd944c2ff
21 changed files with 732 additions and 0 deletions
23
tests/commands/update-readme.test.js
Normal file
23
tests/commands/update-readme.test.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
beforeEach(() => {
|
||||
fs.rmdirSync(path.resolve('tests/__data__/output'), { recursive: true })
|
||||
})
|
||||
|
||||
it('can update readme.md', () => {
|
||||
const result = execSync(
|
||||
'LOGS_PATH=tests/__data__/input/logs node scripts/commands/update-readme.js --config=tests/__data__/input/readme.json',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
const readme = fs.readFileSync(path.resolve('tests/__data__/output/readme.md'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
const expected = fs.readFileSync(path.resolve('tests/__data__/input/readme.md'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
expect(readme).toBe(expected)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue