From 8cdff31159357d6a01df329ec617785f54ac327d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sun, 12 Jan 2025 22:11:34 +0300 Subject: [PATCH] Rename `channels:editor` to `channels:edit` --- package.json | 2 +- scripts/commands/channels/{editor.ts => edit.ts} | 0 .../example.com.channels.xml} | 0 .../example.com.channels.xml} | 0 tests/commands/channels/{editor.test.ts => edit.test.ts} | 8 ++++---- 5 files changed, 5 insertions(+), 5 deletions(-) rename scripts/commands/channels/{editor.ts => edit.ts} (100%) rename tests/__data__/expected/sites/{channels-editor/channels-editor.channels.xml => channels-edit/example.com.channels.xml} (100%) rename tests/__data__/input/{channels-editor/channels-editor.channels.xml => channels-edit/example.com.channels.xml} (100%) rename tests/commands/channels/{editor.test.ts => edit.test.ts} (80%) diff --git a/package.json b/package.json index 44b81cef..95c5f9e8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "api:generate": "npx tsx scripts/commands/api/generate.ts", "channels:lint": "npx tsx scripts/commands/channels/lint.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", "sites:init": "npx tsx scripts/commands/sites/init.ts", "sites:update": "npx tsx scripts/commands/sites/update.ts", diff --git a/scripts/commands/channels/editor.ts b/scripts/commands/channels/edit.ts similarity index 100% rename from scripts/commands/channels/editor.ts rename to scripts/commands/channels/edit.ts diff --git a/tests/__data__/expected/sites/channels-editor/channels-editor.channels.xml b/tests/__data__/expected/sites/channels-edit/example.com.channels.xml similarity index 100% rename from tests/__data__/expected/sites/channels-editor/channels-editor.channels.xml rename to tests/__data__/expected/sites/channels-edit/example.com.channels.xml diff --git a/tests/__data__/input/channels-editor/channels-editor.channels.xml b/tests/__data__/input/channels-edit/example.com.channels.xml similarity index 100% rename from tests/__data__/input/channels-editor/channels-editor.channels.xml rename to tests/__data__/input/channels-edit/example.com.channels.xml diff --git a/tests/commands/channels/editor.test.ts b/tests/commands/channels/edit.test.ts similarity index 80% rename from tests/commands/channels/editor.test.ts rename to tests/commands/channels/edit.test.ts index 0c001df5..e94fe096 100644 --- a/tests/commands/channels/editor.test.ts +++ b/tests/commands/channels/edit.test.ts @@ -16,15 +16,15 @@ if (os.platform() === 'win32') { beforeEach(() => { fs.emptyDirSync('tests/__data__/output') 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' ) }) -describe('channels:editor', () => { +describe('channels:edit', () => { it('shows list of options for a channel', () => { 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' }) if (process.env.DEBUG === 'true') console.log(cmd, stdout) } catch (error) { @@ -40,7 +40,7 @@ describe('channels:editor', () => { "File 'tests/__data__/output/channels.xml' successfully saved" ) 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') ) } })