Rename channels:editor to channels:edit

This commit is contained in:
freearhey 2025-01-12 22:11:34 +03:00
parent 5218372e20
commit 8cdff31159
5 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@
"api:generate": "npx tsx scripts/commands/api/generate.ts", "api:generate": "npx tsx scripts/commands/api/generate.ts",
"channels:lint": "npx tsx scripts/commands/channels/lint.ts", "channels:lint": "npx tsx scripts/commands/channels/lint.ts",
"channels:parse": "npx tsx scripts/commands/channels/parse.ts", "channels:parse": "npx tsx scripts/commands/channels/parse.ts",
"channels:editor": "npx tsx scripts/commands/channels/editor.ts", "channels:edit": "npx tsx scripts/commands/channels/edit.ts",
"channels:validate": "npx tsx scripts/commands/channels/validate.ts", "channels:validate": "npx tsx scripts/commands/channels/validate.ts",
"sites:init": "npx tsx scripts/commands/sites/init.ts", "sites:init": "npx tsx scripts/commands/sites/init.ts",
"sites:update": "npx tsx scripts/commands/sites/update.ts", "sites:update": "npx tsx scripts/commands/sites/update.ts",

View file

@ -16,15 +16,15 @@ if (os.platform() === 'win32') {
beforeEach(() => { beforeEach(() => {
fs.emptyDirSync('tests/__data__/output') fs.emptyDirSync('tests/__data__/output')
fs.copySync( fs.copySync(
'tests/__data__/input/channels-editor/channels-editor.channels.xml', 'tests/__data__/input/channels-edit/example.com.channels.xml',
'tests/__data__/output/channels.xml' 'tests/__data__/output/channels.xml'
) )
}) })
describe('channels:editor', () => { describe('channels:edit', () => {
it('shows list of options for a channel', () => { it('shows list of options for a channel', () => {
try { try {
const cmd = `${ENV_VAR} npm run channels:editor --- tests/__data__/output/channels.xml` const cmd = `${ENV_VAR} npm run channels:edit --- tests/__data__/output/channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' }) const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout) if (process.env.DEBUG === 'true') console.log(cmd, stdout)
} catch (error) { } catch (error) {
@ -40,7 +40,7 @@ describe('channels:editor', () => {
"File 'tests/__data__/output/channels.xml' successfully saved" "File 'tests/__data__/output/channels.xml' successfully saved"
) )
expect(content('tests/__data__/output/channels.xml')).toEqual( expect(content('tests/__data__/output/channels.xml')).toEqual(
content('tests/__data__/expected/sites/channels-editor/channels-editor.channels.xml') content('tests/__data__/expected/sites/channels-edit/example.com.channels.xml')
) )
} }
}) })