diff --git a/packages/cli/src/oldCommands/pg/backups/info.ts b/packages/cli/src/commands/pg/backups/info.ts similarity index 73% rename from packages/cli/src/oldCommands/pg/backups/info.ts rename to packages/cli/src/commands/pg/backups/info.ts index 917ded49cc..e98ac950b7 100644 --- a/packages/cli/src/oldCommands/pg/backups/info.ts +++ b/packages/cli/src/commands/pg/backups/info.ts @@ -1,12 +1,10 @@ -/* -import color from '@heroku-cli/color' +import {color} from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {Args, ux} from '@oclif/core' import {hux} from '@heroku/heroku-cli-util' import {utils} from '@heroku/heroku-cli-util' -import pgBackupsApi from '../../../lib/pg/backups' -import {sortBy} from 'lodash' -import type {BackupTransfer} from '../../../lib/pg/types' +import pgBackupsApi from '../../../lib/pg/backups.js' +import type {BackupTransfer} from '../../../lib/pg/types.js' function status(backup: BackupTransfer) { if (backup.succeeded) { @@ -35,27 +33,27 @@ function compression(compressed: number, total: number) { } export default class Info extends Command { - static topic = 'pg'; - static description = 'get information about a specific backup'; + static topic = 'pg' + static description = 'get information about a specific backup' static flags = { app: flags.app({required: true}), remote: flags.remote(), - }; + } static args = { backup_id: Args.string({description: 'ID of the backup. If omitted, we use the last backup ID.'}), - }; + } getBackup = async (id: string | undefined, app: string) => { let backupID if (id) { - const {num} = pgBackupsApi(app, this.heroku) - backupID = await num(id) + const pgbackups = pgBackupsApi(app, this.heroku) + backupID = await pgbackups.num(id) if (!backupID) throw new Error(`Invalid ID: ${id}`) } else { - let {body: transfers} = await this.heroku.get(`/client/v11/apps/${app}/transfers`, {hostname: utils.pg.host()}) - transfers = sortBy(transfers, 'created_at') + const {body: transfers} = await this.heroku.get(`/client/v11/apps/${app}/transfers`, {hostname: utils.pg.host()}) + transfers.sort((a, b) => a.created_at.localeCompare(b.created_at)) const backups = transfers.filter(t => t.from_type === 'pg_dump' && t.to_type === 'gof3r') const lastBackup = backups.pop() if (!lastBackup) @@ -68,24 +66,24 @@ export default class Info extends Command { } displayBackup = (backup: BackupTransfer, app: string) => { - const {filesize, name} = pgBackupsApi(app, this.heroku) - hux.styledHeader(`Backup ${color.cyan(name(backup))}`) + const pgbackups = pgBackupsApi(app, this.heroku) + hux.styledHeader(`Backup ${color.cyan(pgbackups.name(backup))}`) hux.styledObject({ Database: color.green(backup.from_name), 'Started at': backup.started_at, 'Finished at': backup.finished_at, Status: status(backup), - Type: backup.schedule ? 'Scheduled' : 'Manual', 'Original DB Size': filesize(backup.source_bytes), - 'Backup Size': `${filesize(backup.processed_bytes)}${backup.finished_at ? compression(backup.processed_bytes, backup.source_bytes) : ''}`, + Type: backup.schedule ? 'Scheduled' : 'Manual', 'Original DB Size': pgbackups.filesize(backup.source_bytes), + 'Backup Size': `${pgbackups.filesize(backup.processed_bytes)}${backup.finished_at ? compression(backup.processed_bytes, backup.source_bytes) : ''}`, }, ['Database', 'Started at', 'Finished at', 'Status', 'Type', 'Original DB Size', 'Backup Size']) - ux.log() + ux.stdout('\n') } displayLogs = (backup: BackupTransfer) => { hux.styledHeader('Backup Logs') for (const log of backup.logs) - ux.log(`${log.created_at} ${log.message}`) - ux.log() + ux.stdout(`${log.created_at} ${log.message}\n`) + ux.stdout('\n') } public async run(): Promise { @@ -98,4 +96,4 @@ export default class Info extends Command { this.displayLogs(backup) } } -*/ + diff --git a/packages/cli/src/oldCommands/pg/backups/restore.ts b/packages/cli/src/commands/pg/backups/restore.ts similarity index 83% rename from packages/cli/src/oldCommands/pg/backups/restore.ts rename to packages/cli/src/commands/pg/backups/restore.ts index 616aebef1e..ee95cf9340 100644 --- a/packages/cli/src/oldCommands/pg/backups/restore.ts +++ b/packages/cli/src/commands/pg/backups/restore.ts @@ -1,13 +1,14 @@ -/* -import color from '@heroku-cli/color' +import {color} from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {Args, ux} from '@oclif/core' -import heredoc from 'tsheredoc' -import confirmCommand from '../../../lib/confirmCommand' -import backupsFactory from '../../../lib/pg/backups' +import tsheredoc from 'tsheredoc' +import ConfirmCommand from '../../../lib/confirmCommand.js' +import backupsFactory from '../../../lib/pg/backups.js' import {utils} from '@heroku/heroku-cli-util' -import type {BackupTransfer} from '../../../lib/pg/types' -import {nls} from '../../../nls' +import type {BackupTransfer} from '../../../lib/pg/types.js' +import {nls} from '../../../nls.js' + +const heredoc = tsheredoc.default function dropboxURL(url: string) { if (url.match(/^https?:\/\/www\.dropbox\.com/) && !url.endsWith('dl=1')) { @@ -79,7 +80,7 @@ export default class Restore extends Command { const interval = Math.max(3, waitInterval) const dbResolver = new utils.pg.DatabaseResolver(this.heroku) const {addon: db} = await dbResolver.getAttachment(app as string, args.database) - const {name, wait} = backupsFactory(app, this.heroku) + const pgbackups = backupsFactory(app, this.heroku) let backupURL let backupName = args.backup @@ -98,36 +99,35 @@ export default class Restore extends Command { let backup if (backupName) { - backup = backups.find(b => name(b) === backupName) + backup = backups.find(b => pgbackups.name(b) === backupName) if (!backup) throw new Error(`Backup ${color.cyan(backupName)} not found for ${color.app(backupApp)}`) if (!backup.succeeded) throw new Error(`Backup ${color.cyan(backupName)} for ${color.app(backupApp)} did not complete successfully`) } else { backup = backups.filter(b => b.succeeded).sort((a, b) => { - if (a.finished_at < b.finished_at) { - return -1 - } - - if (a.finished_at > b.finished_at) { - return 1 + if (a.finished_at && b.finished_at) { + return a.finished_at.localeCompare(b.finished_at) } + if (a.finished_at) return 1 + if (b.finished_at) return -1 return 0 }).pop() if (!backup) { throw new Error(`No backups for ${color.app(backupApp)}. Capture one with ${color.cyan.bold('heroku pg:backups:capture')}`) } - backupName = name(backup) + backupName = pgbackups.name(backup) } backupURL = backup.to_url } - await confirmCommand(app, confirm) + const confirmCmd = new ConfirmCommand() + await confirmCmd.confirm(app, confirm) ux.action.start(`Starting restore of ${color.cyan(backupName)} to ${color.yellow(db.name)}`) - ux.log(heredoc(` + ux.stdout(heredoc(` Use Ctrl-C at any time to stop monitoring progress; the backup will continue restoring. Use ${color.cyan.bold('heroku pg:backups')} to check progress. @@ -139,11 +139,11 @@ export default class Restore extends Command { }) ux.action.stop() - await wait('Restoring', restore.uuid, interval, verbose, db.app.id as string) + await pgbackups.wait('Restoring', restore.uuid, interval, verbose, db.app.id as string) } protected getSortedExtensions(extensions: string | null | undefined): string[] | undefined { return extensions?.split(',').map(ext => ext.trim().toLowerCase()).sort() } } -*/ + diff --git a/packages/cli/src/oldCommands/pg/backups/schedule.ts b/packages/cli/src/commands/pg/backups/schedule.ts similarity index 96% rename from packages/cli/src/oldCommands/pg/backups/schedule.ts rename to packages/cli/src/commands/pg/backups/schedule.ts index b0e86789a3..f478168f4e 100644 --- a/packages/cli/src/oldCommands/pg/backups/schedule.ts +++ b/packages/cli/src/commands/pg/backups/schedule.ts @@ -1,11 +1,10 @@ -/* -import color from '@heroku-cli/color' +import {color} from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {Args, ux} from '@oclif/core' import {utils} from '@heroku/heroku-cli-util' -import {PgDatabase} from '../../../lib/pg/types' +import {PgDatabase} from '../../../lib/pg/types.js' import {HTTPError} from '@heroku/http-call' -import {nls} from '../../../nls' +import {nls} from '../../../nls.js' type Timezone = { PST: string @@ -103,4 +102,4 @@ export default class Schedule extends Command { ux.action.stop() } } -*/ + diff --git a/packages/cli/src/oldCommands/pg/backups/schedules.ts b/packages/cli/src/commands/pg/backups/schedules.ts similarity index 78% rename from packages/cli/src/oldCommands/pg/backups/schedules.ts rename to packages/cli/src/commands/pg/backups/schedules.ts index 1182fd9071..c2113c6c00 100644 --- a/packages/cli/src/oldCommands/pg/backups/schedules.ts +++ b/packages/cli/src/commands/pg/backups/schedules.ts @@ -1,18 +1,17 @@ -/* -import color from '@heroku-cli/color' +import {color} from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {ux} from '@oclif/core' import {hux} from '@heroku/heroku-cli-util' import {utils} from '@heroku/heroku-cli-util' -import type {TransferSchedule} from '../../../lib/pg/types' +import type {TransferSchedule} from '../../../lib/pg/types.js' export default class Schedules extends Command { - static topic = 'pg'; - static description = 'list backup schedule'; + static topic = 'pg' + static description = 'list backup schedule' static flags = { app: flags.app({required: true}), remote: flags.remote(), - }; + } public async run(): Promise { const {flags} = await this.parse(Schedules) @@ -25,9 +24,9 @@ export default class Schedules extends Command { } else { hux.styledHeader('Backup Schedules') for (const s of schedules) { - ux.log(`${color.green(s.name)}: daily at ${s.hour}:00 ${s.timezone}`) + ux.stdout(`${color.green(s.name)}: daily at ${s.hour}:00 ${s.timezone}\n`) } } } } -*/ + diff --git a/packages/cli/src/oldCommands/pg/backups/unschedule.ts b/packages/cli/src/commands/pg/backups/unschedule.ts similarity index 90% rename from packages/cli/src/oldCommands/pg/backups/unschedule.ts rename to packages/cli/src/commands/pg/backups/unschedule.ts index f3c025eec9..920220c2a1 100644 --- a/packages/cli/src/oldCommands/pg/backups/unschedule.ts +++ b/packages/cli/src/commands/pg/backups/unschedule.ts @@ -1,22 +1,21 @@ -/* -import color from '@heroku-cli/color' +import {color} from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {Args, ux} from '@oclif/core' import {utils} from '@heroku/heroku-cli-util' -import {TransferSchedule} from '../../../lib/pg/types' -import {nls} from '../../../nls' +import {TransferSchedule} from '../../../lib/pg/types.js' +import {nls} from '../../../nls.js' export default class Unschedule extends Command { - static topic = 'pg'; - static description = 'stop daily backups'; + static topic = 'pg' + static description = 'stop daily backups' static flags = { app: flags.app({required: true}), remote: flags.remote(), - }; + } static args = { database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:arbitrary:suffix')}`}), - }; + } public async run(): Promise { const {flags, args} = await this.parse(Unschedule) @@ -57,4 +56,4 @@ export default class Unschedule extends Command { ux.action.stop() } } -*/ + diff --git a/packages/cli/src/commands/pg/backups/url.ts b/packages/cli/src/commands/pg/backups/url.ts new file mode 100644 index 0000000000..ebdaecd8f1 --- /dev/null +++ b/packages/cli/src/commands/pg/backups/url.ts @@ -0,0 +1,44 @@ +import {color} from '@heroku-cli/color' +import {Command, flags} from '@heroku-cli/command' +import {Args, ux} from '@oclif/core' +import {utils} from '@heroku/heroku-cli-util' +import pgBackupsApi from '../../../lib/pg/backups.js' +import type {BackupTransfer, PublicUrlResponse} from '../../../lib/pg/types.js' + +export default class Url extends Command { + static topic = 'pg' + static description = 'get secret but publicly accessible URL of a backup' + static flags = { + app: flags.app({required: true}), + remote: flags.remote(), + } + + static args = { + backup_id: Args.string({description: 'ID of the backup. If omitted, we use the last backup ID.'}), + } + + public async run(): Promise { + const {flags, args} = await this.parse(Url) + const {backup_id} = args + const {app} = flags + + let num + if (backup_id) { + num = await pgBackupsApi(app, this.heroku).num(backup_id) + if (!num) + throw new Error(`Invalid Backup: ${backup_id}`) + } else { + const {body: transfers} = await this.heroku.get(`/client/v11/apps/${app}/transfers`, {hostname: utils.pg.host()}) + const succeededBackups = transfers.filter(t => t.succeeded && t.to_type === 'gof3r') + succeededBackups.sort((a, b) => a.created_at.localeCompare(b.created_at)) + const lastBackup = succeededBackups.pop() + if (!lastBackup) + throw new Error(`No backups on ${color.app(app)}. Capture one with ${color.cyan.bold('heroku pg:backups:capture')}`) + num = lastBackup.num + } + + const {body: info} = await this.heroku.post(`/client/v11/apps/${app}/transfers/${num}/actions/public-url`, {hostname: utils.pg.host()}) + ux.stdout(info.url + '\n') + } +} + diff --git a/packages/cli/src/oldCommands/pg/backups/url.ts b/packages/cli/src/oldCommands/pg/backups/url.ts deleted file mode 100644 index 4d9d14b1fc..0000000000 --- a/packages/cli/src/oldCommands/pg/backups/url.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -import color from '@heroku-cli/color' -import {Command, flags} from '@heroku-cli/command' -import {Args, ux} from '@oclif/core' -import {utils} from '@heroku/heroku-cli-util' -import pgBackupsApi from '../../../lib/pg/backups' -import {sortBy} from 'lodash' -import type {BackupTransfer, PublicUrlResponse} from '../../../lib/pg/types' - -export default class Url extends Command { - static topic = 'pg'; - static description = 'get secret but publicly accessible URL of a backup'; - static flags = { - app: flags.app({required: true}), - remote: flags.remote(), - }; - - static args = { - backup_id: Args.string({description: 'ID of the backup. If omitted, we use the last backup ID.'}), - }; - - public async run(): Promise { - const {flags, args} = await this.parse(Url) - const {backup_id} = args - const {app} = flags - - let num - if (backup_id) { - num = await pgBackupsApi(app, this.heroku).num(backup_id) - if (!num) - throw new Error(`Invalid Backup: ${backup_id}`) - } else { - const {body: transfers} = await this.heroku.get(`/client/v11/apps/${app}/transfers`, {hostname: utils.pg.host()}) - const lastBackup = sortBy(transfers.filter(t => t.succeeded && t.to_type === 'gof3r'), 'created_at') - .pop() - if (!lastBackup) - throw new Error(`No backups on ${color.app(app)}. Capture one with ${color.cyan.bold('heroku pg:backups:capture')}`) - num = lastBackup.num - } - - const {body: info} = await this.heroku.post(`/client/v11/apps/${app}/transfers/${num}/actions/public-url`, {hostname: utils.pg.host()}) - ux.log(info.url) - } -} -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts index 3eda985e7f..441998f9c2 100644 --- a/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts @@ -1,5 +1,5 @@ import {stdout} from 'stdout-stderr' -// import Cmd from '../../../../../src/commands/pg/backups/info' +import Cmd from '../../../../../src/commands/pg/backups/info.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' import expectOutput from '../../../../helpers/utils/expectOutput.js' @@ -116,9 +116,6 @@ const shouldInfo = function (cmdRun: (args: string[]) => Promise) { }) } -/* describe('pg:backups:info', function () { shouldInfo((args: string[]) => runCommand(Cmd, args)) }) - -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/restore.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/restore.unit.test.ts index 7de4cbc44b..20fabbddb9 100644 --- a/packages/cli/test/unit/commands/pg/backups/restore.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/restore.unit.test.ts @@ -1,13 +1,12 @@ import {expect} from '@oclif/test' import nock from 'nock' import {stdout, stderr} from 'stdout-stderr' -import heredoc from 'tsheredoc' -// import Cmd from '../../../../../src/commands/pg/backups/restore' +import tsheredoc from 'tsheredoc' +import Cmd from '../../../../../src/commands/pg/backups/restore.js' import runCommand from '../../../../helpers/runCommand.js' +const heredoc = tsheredoc.default const addon = {id: 1, name: 'postgres-1', plan: {name: 'heroku-postgresql:standard-0'}, app: {name: 'myapp'}} - -/* describe('pg:backups:restore', function () { let pg: nock.Scope let api: nock.Scope @@ -57,9 +56,7 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of b005 to postgres-1... Starting restore of b005 to postgres-1... done - Restoring... Restoring... done `)) }) @@ -80,9 +77,7 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of b005 to postgres-1... Starting restore of b005 to postgres-1... done - Restoring... Restoring... done `)) }) @@ -103,9 +98,7 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of b005 to postgres-1... Starting restore of b005 to postgres-1... done - Restoring... Restoring... done `)) }) @@ -146,9 +139,7 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of b005 to postgres-1... Starting restore of b005 to postgres-1... done - Restoring... Restoring... done `)) }) @@ -183,9 +174,7 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of https://www.dropbox.com to postgres-1... Starting restore of https://www.dropbox.com to postgres-1... done - Restoring... Restoring... done `)) }) @@ -225,13 +214,9 @@ describe('pg:backups:restore', function () { `)) expect(stderr.output).to.equal(heredoc(` - Starting restore of b005 to postgres-1... Starting restore of b005 to postgres-1... done - Restoring... Restoring... done `)) }) }) }) - -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/schedule.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/schedule.unit.test.ts index 85f177146c..e6f8e39f1f 100644 --- a/packages/cli/test/unit/commands/pg/backups/schedule.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/schedule.unit.test.ts @@ -1,13 +1,14 @@ import {stderr, stdout} from 'stdout-stderr' -// import Cmd from '../../../../../src/commands/pg/backups/schedule' +import Cmd from '../../../../../src/commands/pg/backups/schedule.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' -import heredoc from 'tsheredoc' +import tsheredoc from 'tsheredoc' import {expect} from 'chai' import stripAnsi from 'strip-ansi' -// import {CLIError} from '@oclif/core/lib/errors' -/* +const heredoc = tsheredoc.default + +type CLIError = Error & {oclif?: {exit?: number}} describe('pg:backups:schedule', function () { let api: nock.Scope let data: nock.Scope @@ -61,10 +62,8 @@ describe('pg:backups:schedule', function () { await runCommand(Cmd, ['--at', '06:00 EDT', '--app', 'myapp']) expect(stdout.output).to.equal('') - expect(stderr.output).to.include(heredoc(` - Scheduling automatic daily backups of postgres-1 at 06:00 America/New_York... - Scheduling automatic daily backups of postgres-1 at 06:00 America/New_York... done - `)) + expect(stderr.output).to.include('Scheduling automatic daily backups of postgres-1 at 06:00 America/New_York') + expect(stderr.output).to.include('done') }) it('warns user that logical backups are error prone if continuous protection is on', async function () { @@ -98,9 +97,9 @@ describe('pg:backups:schedule', function () { try { await runCommand(Cmd, ['--at', '24:00', '--app', 'myapp']) } catch (error: unknown) { - const {message, oclif} = error as CLIError - expect(message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") - expect(oclif.exit).to.equal(1) + const err = error as CLIError + expect(err.message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") + expect(err.oclif?.exit).to.equal(1) } }) @@ -108,9 +107,9 @@ describe('pg:backups:schedule', function () { try { await runCommand(Cmd, ['--at', '01:00 New York', '--app', 'myapp']) } catch (error: unknown) { - const {message, oclif} = error as CLIError - expect(message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") - expect(oclif.exit).to.equal(1) + const err = error as CLIError + expect(err.message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") + expect(err.oclif?.exit).to.equal(1) } }) @@ -118,9 +117,9 @@ describe('pg:backups:schedule', function () { try { await runCommand(Cmd, ['--at', '06:15 EDT', '--app', 'myapp']) } catch (error: unknown) { - const {message, oclif} = error as CLIError - expect(message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") - expect(oclif.exit).to.equal(1) + const err = error as CLIError + expect(err.message).to.eq("Invalid schedule format: expected --at '[HOUR]:00 [TIMEZONE]'") + expect(err.oclif?.exit).to.equal(1) } }) @@ -157,8 +156,8 @@ describe('pg:backups:schedule', function () { try { await runCommand(Cmd, ['--at', '06:00 New_York', '--app', 'myapp']) } catch (error: unknown) { - const {message} = error as CLIError - expect(message).to.contain('Bad request.') + const err = error as CLIError + expect(err.message).to.contain('Bad request.') } api.done() @@ -166,5 +165,3 @@ describe('pg:backups:schedule', function () { nock.cleanAll() }) }) - -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/schedules.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/schedules.unit.test.ts index 7db8d34f69..dbfd51bbab 100644 --- a/packages/cli/test/unit/commands/pg/backups/schedules.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/schedules.unit.test.ts @@ -1,5 +1,5 @@ import {stderr, stdout} from 'stdout-stderr' -// import Cmd from '../../../../../src/commands/pg/backups/schedules' +import Cmd from '../../../../../src/commands/pg/backups/schedules.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' import expectOutput from '../../../../helpers/utils/expectOutput.js' @@ -18,7 +18,7 @@ const shouldSchedules = function (cmdRun: (args: string[]) => Promise) { .reply(200, []) await cmdRun(['--app', 'myapp']) .catch((error: Error) => { - expect(error.message).to.equal('No heroku-postgresql databases on myapp') + expect(error.message).to.equal('No Heroku Postgres legacy database on myapp') }) }) @@ -57,9 +57,6 @@ const shouldSchedules = function (cmdRun: (args: string[]) => Promise) { }) } -/* describe('pg:backups:schedules', function () { shouldSchedules((args: string[]) => runCommand(Cmd, args)) }) - -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/unschedule.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/unschedule.unit.test.ts index b378bd44e6..996e1ec6f1 100644 --- a/packages/cli/test/unit/commands/pg/backups/unschedule.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/unschedule.unit.test.ts @@ -1,5 +1,5 @@ import {stderr, stdout} from 'stdout-stderr' -// import Cmd from '../../../../../src/commands/pg/backups/unschedule' +import Cmd from '../../../../../src/commands/pg/backups/unschedule.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' import tsheredoc from 'tsheredoc' @@ -39,13 +39,11 @@ const shouldUnschedule = function (cmdRun: (args: string[]) => Promise) { await cmdRun(['--app', appName]) expectOutput(stdout.output, '') expectOutput(stderr.output, heredoc(` - Unscheduling DATABASE_URL daily backups... Unscheduling DATABASE_URL daily backups... done `)) }) } -/* describe('pg:backups:unschedule', function () { shouldUnschedule((args: string[]) => runCommand(Cmd, args)) }) @@ -89,5 +87,3 @@ describe('pg:backups:unschedule error state', function () { .catch(error => expect(stripAnsi(error.message)).to.equal(`Specify schedule on ⬢ ${appName}. Existing schedules: DATABASE_URL, DATABASE_URL2`)) }) }) - -*/ diff --git a/packages/cli/test/unit/commands/pg/backups/url.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/url.unit.test.ts index 35b0b72973..88d7c32001 100644 --- a/packages/cli/test/unit/commands/pg/backups/url.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/url.unit.test.ts @@ -1,5 +1,5 @@ import {stdout} from 'stdout-stderr' -// import Cmd from '../../../../../src/commands/pg/backups/url' +import Cmd from '../../../../../src/commands/pg/backups/url.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' import expectOutput from '../../../../helpers/utils/expectOutput.js' @@ -40,9 +40,6 @@ const shouldUrl = function (cmdRun: (args: string[]) => Promise) { }) } -/* describe('pg:backups:url', function () { shouldUrl((args: string[]) => runCommand(Cmd, args)) }) - -*/