diff --git a/.talismanrc b/.talismanrc index f2f60dd..2557289 100644 --- a/.talismanrc +++ b/.talismanrc @@ -87,7 +87,7 @@ fileignoreconfig: - "'SECRET=hunter2'" - "formFieldKey" - filename: test/integration/projects-create.test.ts - checksum: 6985ba0adee092fcf3dd4a432614298839deba0bef2867bc3bc8d6747946dc66 + checksum: 0161c3bba176134df0bc1a3a29cda4e1c0b143afbee202c110cdfed19b08d8e0 - filename: test/fixtures/README.md checksum: d801c84c8b7d7f38f967573e9a3a70da4405b7cbcbf10d2a6e5be3d65fb3daa1 allowed_patterns: @@ -330,13 +330,13 @@ fileignoreconfig: - "-p, --password" - "-u, --username" - filename: test/integration/environments-create.test.ts - checksum: 898d30a1a16339ffd0e495eb1b22ea7c08b947c9012ad17a3dc61c905b07a091 + checksum: 1b87f454b1534bf0b73ebb52cdaf9af231beb57d5746e521a4504edad819c89a - filename: src/commands/launch/variables/list.test.ts checksum: 87ccb762f4931326fc50bca1c01aeb4a16d552e4dfa141d00370fdfafa4363be - filename: src/commands/launch/variables/set.test.ts checksum: a6fc222527e946aee1c0015e3961bc3dff13aabec40c2162e7d2d3f2bb2d2cde - filename: src/commands/launch/variables/unset.test.ts - checksum: 709e849b1ef834bdc433936438110ff3f79b8cc0e7bec0f505c56ffd4f67bd8b + checksum: e732a3f563dea1f788293d108f678fc80c9dad7af1d482f0fd50b35e9a6f51e8 - filename: src/commands/launch/variables/unset.ts checksum: b25c2b1547a1ed5b216c57b26bc18744ad04746e01efcc40e9469d1a5e472537 - filename: src/environments/environment.errors.test.ts @@ -346,9 +346,9 @@ fileignoreconfig: - filename: src/stacks/stacks.api.ts checksum: d59622ca6411b93d5469a1895b08ccde4b9cd83fbb909c82076ea70d74b5e1e4 - filename: src/variables/variable.chooser.ts - checksum: 15a6b8a1a974c8d0396ac18d8c9d39c8bc9f70efbf41ce0eef79180ce16b2f04 + checksum: c776a4184eb1819055622784bc6f3342b67bc1babdca0cdbbe72a4a871cc2498 - filename: src/variables/variable.create.test.ts - checksum: 908f39b56943d8bc343b93057f83cff1b718ecdc0bcbff5ed9b759c010b4029d + checksum: c888e2a4aca9c6855c79d743368387aeb0ab5db907beca8bef1113bc05a5260d - filename: src/variables/variable.dotenv.test.ts checksum: c3d5e33189736bb42b7c4fac7375cf0307681b34feca4830b49331f55a130f78 - filename: src/variables/variable.dotenv.ts @@ -368,7 +368,7 @@ fileignoreconfig: - filename: src/variables/variable.page.test.ts checksum: 9a4e63c0dbfd35b499149a98ce5642787097e9491746b4b874b2eda88f1d2b50 - filename: src/variables/variable.parse.test.ts - checksum: d620d89c4b5cafb80dcf696f430c8fa4e696dfc744f814bcdd74324243010460 + checksum: af1ca4483e3771a346d9e068ffd39cad3e297149c3327f26b5e5e9e8a6a921e0 - filename: src/variables/variable.parse.ts checksum: 87be9f454ce0ffb48ff5729ccd3c1b105ce9f1030b32278c3359555b983c2142 - filename: src/variables/variable.presenter.test.ts @@ -376,7 +376,7 @@ fileignoreconfig: - filename: src/variables/variable.presenter.ts checksum: ee8e4dcf75ad7e849d1e8e64ce6a6549d13fc62dc9aa322d96eb2e725d629db5 - filename: src/variables/variable.set.test.ts - checksum: df7d36ff83d1489301afad5418ebe76338adb7bcad51d1e738f989362be46903 + checksum: e9b6a1bab4165ead293ca33aa921550cf8e46dd6821d0718f33856685b5542be - filename: src/variables/variable.sources.test.ts checksum: 63ad95e998cbc6d33fabe4ce76797e8788b17abec3833b4fed2360eab01a6f79 - filename: src/variables/variable.sources.ts @@ -390,9 +390,9 @@ fileignoreconfig: - filename: src/variables/variable.summary.ts checksum: 0da287557a5c4280074d1a26aeff4f7d95b205e4266ff47c18b62665134f5bdc - filename: src/variables/variable.unset.test.ts - checksum: d449ba8483eeb932c155b2b210ce2088785d0961680eaa3efd036553c46579e2 + checksum: 8797c7aa2960fc0328d5cab8cfdddf674ac624ace95f79338520851a2c7b732a - filename: src/variables/variable.unset.ts - checksum: 0d21f5878aa1f05dcafc864dd7dcb23e3155d3d24b97e248e62ad9bf5bcd7745 + checksum: 4050a023edd3c6db1507eb2d0f2815d8c0c03622b2810b4977a8fba6e83818fe - filename: src/variables/variable.values.test.ts checksum: 56725066fdabce3afea373c70bee10a6db4c1409e3a8f6f1e7f191ea6e602419 - filename: src/variables/variable.values.ts @@ -410,5 +410,5 @@ fileignoreconfig: - filename: test/integration/variables-list.test.ts checksum: 5ea6a0fcd331496ca19773e90dab81e09eb5290b8f22a1880bffc7916f3778b2 - filename: test/integration/variables-set-unset.test.ts - checksum: cafc4eed5f80fe9763cb9362acce9ba51663da7a615abf683b23545f5342b913 + checksum: 7af9dde4711849d0908d0de54347055a7c2a8d8920f9fcc0b24382b02bceaed9 version: "1.0" diff --git a/src/commands/launch/variables/unset.test.ts b/src/commands/launch/variables/unset.test.ts index e30aa84..5677540 100644 --- a/src/commands/launch/variables/unset.test.ts +++ b/src/commands/launch/variables/unset.test.ts @@ -72,11 +72,11 @@ describe('launch:variables:unset', () => { await command.run(); expect(inquired).toEqual([ - { type: 'confirm', name: 'confirm', message: 'Are you sure you want to remove API_KEY from "staging"?', default: false }, + { type: 'confirm', name: 'confirm', message: 'Are you sure you want to remove the variable API_KEY from the "staging" environment?', default: false }, ]); expect(calls).toEqual(['get', 'patch']); expect(updates).toEqual([{ ...SCOPE, unset: ['API_KEY'] }]); - expect(lines).toEqual(['✔ API_KEY removed from staging.']); + expect(lines).toEqual(['✔ Variable API_KEY removed from the "staging" environment.']); expect(lines.join('')).not.toContain('never-printed-value'); }); @@ -87,7 +87,7 @@ describe('launch:variables:unset', () => { expect(inquired).toEqual([]); expect(calls).toEqual(['get', 'patch']); - expect(lines).toEqual(['✔ API_KEY removed from staging.']); + expect(lines).toEqual(['✔ Variable API_KEY removed from the "staging" environment.']); }); it('says the variables were not removed and exits 3 without writing when the user declines', async () => { @@ -108,7 +108,7 @@ describe('launch:variables:unset', () => { expect(error).toBeInstanceOf(UsageError); expect(error.exitCode).toBe(2); expect(error.message).toBe( - 'Are you sure you want to remove API_KEY from "staging"? Pass --yes to confirm without an interactive terminal.', + 'Are you sure you want to remove the variable API_KEY from the "staging" environment? Pass --yes to confirm without an interactive terminal.', ); expect(inquired).toEqual([]); expect(updates).toEqual([]); diff --git a/src/variables/variable.chooser.ts b/src/variables/variable.chooser.ts index 054514e..8702d1c 100644 --- a/src/variables/variable.chooser.ts +++ b/src/variables/variable.chooser.ts @@ -22,11 +22,12 @@ export interface ChooserPrompt { export const STACK_CHOICE = 'Import variables from a stack'; export const FILE_CHOICE = 'Import variables from a dotenv file'; -export const TYPED_CHOICE = 'Type KEY=VALUE pairs'; +export const TYPED_CHOICE = 'Manually add custom variables'; export const SKIP_CHOICE = 'Skip adding environment variables'; const FILE_QUESTION = 'Path to the dotenv file'; -const TYPED_QUESTION = 'KEY=VALUE pairs separated by spaces'; -const TYPED_LABEL = '--var'; +export const TYPED_QUESTION = + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")'; +const TYPED_LABEL = 'manual entry'; async function askForFile( detected: string | undefined, diff --git a/src/variables/variable.create.test.ts b/src/variables/variable.create.test.ts index 5df4272..78f184e 100644 --- a/src/variables/variable.create.test.ts +++ b/src/variables/variable.create.test.ts @@ -10,7 +10,7 @@ const SAVED_TOKEN = `cs-${randomUUID()}`; const STACK = 'Import variables from a stack'; const SKIP = 'Skip adding environment variables'; const FILE = 'Import variables from a dotenv file'; -const TYPED = 'Type KEY=VALUE pairs'; +const TYPED = 'Manually add custom variables'; function fakes(options: { isTTY?: boolean; answers?: Record; files?: Record } = {}) { const files = options.files ?? {}; @@ -188,7 +188,7 @@ describe('variable create', () => { answers: { 'Add environment variables': [FILE, TYPED], 'Path to the dotenv file': 'a.env', - 'KEY=VALUE pairs separated by spaces': 'API_URL="sk live secret" N=2', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'API_URL="sk live secret" N=2', }, }); @@ -199,7 +199,8 @@ describe('variable create', () => { { key: 'F', value: '1' }, { key: 'N', value: '2' }, ]); - expect(printed.join('\n')).toContain('API_URL overridden by --var'); + expect(printed.join('\n')).toContain('API_URL overridden by manual entry'); + expect(printed.join('\n')).not.toContain('--var'); expect(printed.join('\n')).not.toContain('sk live secret'); }); @@ -207,7 +208,7 @@ describe('variable create', () => { const { services, io, asked } = fakes({ answers: { 'Add environment variables': [TYPED], - 'KEY=VALUE pairs separated by spaces': 'API_KEY', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'API_KEY', 'Value for API_KEY': 's3cret', }, }); @@ -220,7 +221,7 @@ describe('variable create', () => { it('echoes the typed keys with masked values and never a value', async () => { const { services, io, printed } = fakes({ - answers: { 'Add environment variables': [TYPED], 'KEY=VALUE pairs separated by spaces': 'A=never-printed-value' }, + answers: { 'Add environment variables': [TYPED], 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'A=never-printed-value' }, }); await variablesForCreate(NONE, services, io); @@ -251,7 +252,7 @@ describe('variable create', () => { ); const malformed = fakes({ - answers: { 'Add environment variables': [TYPED], 'KEY=VALUE pairs separated by spaces': 'A="oops' }, + answers: { 'Add environment variables': [TYPED], 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'A="oops' }, }); await expect(variablesForCreate(NONE, malformed.services, malformed.io)).rejects.toThrow( @@ -301,7 +302,7 @@ describe('variable create', () => { 'Add environment variables': [STACK, TYPED], Stack: '0', 'Delivery token': '0', - 'KEY=VALUE pairs separated by spaces': 'EXTRA=1', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'EXTRA=1', }, }); @@ -311,7 +312,7 @@ describe('variable create', () => { 'Add environment variables', 'Stack', 'Delivery token', - 'KEY=VALUE pairs separated by spaces', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")', ]); expect(variables.map((variable) => variable.key)).toEqual([ 'CONTENTSTACK_API_HOST', diff --git a/src/variables/variable.parse.test.ts b/src/variables/variable.parse.test.ts index e4604e2..668ad3c 100644 --- a/src/variables/variable.parse.test.ts +++ b/src/variables/variable.parse.test.ts @@ -1,4 +1,5 @@ import { UsageError } from '../core/errors'; +import { TYPED_QUESTION } from './variable.chooser'; import { parseAssignment, splitLine } from './variable.parse'; describe('variable parse', () => { @@ -80,4 +81,14 @@ describe('variable parse split line', () => { expect(() => splitLine(line)).toThrow(UsageError); expect(() => splitLine(line)).toThrow('The line has an opening quote with no closing quote.'); }); + + it('reads the example in the manual entry question as three pairs, one per separator and one quoted', () => { + const example = /\(Ex: (.+)\)$/.exec(TYPED_QUESTION)?.[1] ?? ''; + + expect(splitLine(example).map(parseAssignment)).toEqual([ + { key: 'KEY1', value: 'value1' }, + { key: 'KEY2', value: 'value2' }, + { key: 'KEY3', value: 'value with spaces' }, + ]); + }); }); diff --git a/src/variables/variable.set.test.ts b/src/variables/variable.set.test.ts index f73ae54..f642f33 100644 --- a/src/variables/variable.set.test.ts +++ b/src/variables/variable.set.test.ts @@ -259,7 +259,7 @@ describe('default variable io', () => { describe('asking which sources to use', () => { const STACK = 'Import variables from a stack'; const FILE = 'Import variables from a dotenv file'; - const TYPED = 'Type KEY=VALUE pairs'; + const TYPED = 'Manually add custom variables'; it('offers the three sources, with no Skip, on a terminal when no source flag was given', async () => { const { setter, asked } = fakes({}, { 'Add variables from': [] }); @@ -303,7 +303,7 @@ describe('default variable io', () => { { 'Add variables from': [FILE, TYPED], 'Path to the dotenv file': '/work/.env.local', - 'KEY=VALUE pairs separated by spaces': 'TYPED=2', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'TYPED=2', }, ); @@ -314,7 +314,7 @@ describe('default variable io', () => { { key: 'FROM_FILE', value: '1' }, { key: 'TYPED', value: '2' }, ]); - expect(printed.at(-1)).toBe('✔ 2 variables set — 1 from /work/.env.local, 1 from --var'); + expect(printed.at(-1)).toBe('✔ 2 variables set — 1 from /work/.env.local, 1 from manual entry'); }); it.each([ diff --git a/src/variables/variable.unset.test.ts b/src/variables/variable.unset.test.ts index 598c6d4..1f9d64c 100644 --- a/src/variables/variable.unset.test.ts +++ b/src/variables/variable.unset.test.ts @@ -59,9 +59,9 @@ describe('variable remover', () => { expect(removed).toBe(true); expect(order).toEqual(['get', 'confirm', 'patch']); - expect(questions).toEqual(['Are you sure you want to remove API_KEY from "staging"?']); + expect(questions).toEqual(['Are you sure you want to remove the variable API_KEY from the "staging" environment?']); expect(patches).toEqual([{ ...SCOPE, unset: ['API_KEY'] }]); - expect(printed).toEqual(['✔ API_KEY removed from staging.']); + expect(printed).toEqual(['✔ Variable API_KEY removed from the "staging" environment.']); }); it('names several keys together', async () => { @@ -69,8 +69,8 @@ describe('variable remover', () => { await remover.remove({ ...SCOPE, keys: ['API_KEY', 'DEBUG'] }); - expect(questions).toEqual(['Are you sure you want to remove API_KEY, DEBUG from "staging"?']); - expect(printed).toEqual(['✔ API_KEY, DEBUG removed from staging.']); + expect(questions).toEqual(['Are you sure you want to remove the variables API_KEY, DEBUG from the "staging" environment?']); + expect(printed).toEqual(['✔ Variables API_KEY, DEBUG removed from the "staging" environment.']); }); it('falls back to the environment reference when the environment carries no name', async () => { @@ -78,8 +78,8 @@ describe('variable remover', () => { await remover.remove({ ...SCOPE, keys: ['A'] }); - expect(questions).toEqual(['Are you sure you want to remove A from "env1"?']); - expect(printed).toEqual(['✔ A removed from env1.']); + expect(questions).toEqual(['Are you sure you want to remove the variable A from the "env1" environment?']); + expect(printed).toEqual(['✔ Variable A removed from the "env1" environment.']); }); it('returns false and changes nothing when the user declines', async () => { diff --git a/src/variables/variable.unset.ts b/src/variables/variable.unset.ts index 19a82f3..dbd8a59 100644 --- a/src/variables/variable.unset.ts +++ b/src/variables/variable.unset.ts @@ -27,16 +27,24 @@ export class VariableRemover { } const name = held.name ?? environment; - const listed = [...new Set(request.keys)].join(', '); + const keys = [...new Set(request.keys)]; + const listed = keys.join(', '); + const single = keys.length === 1; + const subject = `${single ? 'variable' : 'variables'} ${listed}`; + const question = `Are you sure you want to remove the ${subject} from the "${name}" environment?`; - if (!(await this.confirm(`Are you sure you want to remove ${listed} from "${name}"?`))) { + if (!(await this.confirm(question))) { return false; } await unsetVariables(this.services.api.variables, scope, request.keys); this.services.ux.print( - styled(`✔ ${listed} removed from ${name}.`, 'green', this.services.outputIsTTY === true), + styled( + `✔ ${single ? 'Variable' : 'Variables'} ${listed} removed from the "${name}" environment.`, + 'green', + this.services.outputIsTTY === true, + ), ); return true; diff --git a/test/integration/environments-create.test.ts b/test/integration/environments-create.test.ts index 2f7a638..ede62a6 100644 --- a/test/integration/environments-create.test.ts +++ b/test/integration/environments-create.test.ts @@ -200,9 +200,9 @@ describe('integration: launch:env:create on the wire', () => { const file = join(DATA_DIR, `env-create-${randomBytes(4).toString('hex')}.env`); writeFileSync(file, 'API_URL=from-file\nFROM_FILE=1\n'); const prompts = answerPrompts({ - 'Add environment variables': ['Import variables from a dotenv file', 'Type KEY=VALUE pairs'], + 'Add environment variables': ['Import variables from a dotenv file', 'Manually add custom variables'], 'Path to the dotenv file': file, - 'KEY=VALUE pairs separated by spaces': 'API_URL=typed DEBUG=true', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'API_URL=typed DEBUG=true', }); const sent: { environmentVariables?: unknown }[] = []; stubCreate(sent); @@ -214,7 +214,7 @@ describe('integration: launch:env:create on the wire', () => { expect(prompts.messages).toEqual([ 'Add environment variables', 'Path to the dotenv file', - 'KEY=VALUE pairs separated by spaces', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")', ]); expect(sent[0].environmentVariables).toEqual([ { key: 'API_URL', value: 'typed' }, @@ -233,12 +233,12 @@ describe('integration: launch:env:create on the wire', () => { 'Add environment variables': [ 'Import variables from a stack', 'Import variables from a dotenv file', - 'Type KEY=VALUE pairs', + 'Manually add custom variables', ], Stack: '0', 'Delivery token': '0', 'Path to the dotenv file': file, - 'KEY=VALUE pairs separated by spaces': 'FROM_FILE=typed EXTRA=1', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'FROM_FILE=typed EXTRA=1', }); const sent: { environmentVariables?: unknown }[] = []; stubCreate(sent); @@ -253,7 +253,7 @@ describe('integration: launch:env:create on the wire', () => { 'Stack', 'Delivery token', 'Path to the dotenv file', - 'KEY=VALUE pairs separated by spaces', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")', ]); expect(lookups.every((scope) => scope.isDone())).toBe(true); expect(sent[0].environmentVariables).toEqual([ @@ -295,7 +295,7 @@ describe('integration: launch:env:create on the wire', () => { }); it('refuses Skip combined with another source before creating anything', async () => { - answerPrompts({ 'Add environment variables': ['Skip adding environment variables', 'Type KEY=VALUE pairs'] }); + answerPrompts({ 'Add environment variables': ['Skip adding environment variables', 'Manually add custom variables'] }); const sent: unknown[] = []; stubCreate(sent); diff --git a/test/integration/projects-create.test.ts b/test/integration/projects-create.test.ts index c9b297e..865c4fa 100644 --- a/test/integration/projects-create.test.ts +++ b/test/integration/projects-create.test.ts @@ -925,9 +925,9 @@ describe('integration: launch:projects:create on the wire', () => { const file = join(dataDir, 'picked.env'); writeFileSync(file, 'API_URL=from-file\nFROM_FILE=1\n'); const prompts = answerPrompts({ - 'Add environment variables': ['Import variables from a dotenv file', 'Type KEY=VALUE pairs'], + 'Add environment variables': ['Import variables from a dotenv file', 'Manually add custom variables'], 'Path to the dotenv file': file, - 'KEY=VALUE pairs separated by spaces': 'API_URL=typed DEBUG=true', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'API_URL=typed DEBUG=true', }); stubGitLookups(); const create = captureBody(); @@ -939,7 +939,7 @@ describe('integration: launch:projects:create on the wire', () => { expect(prompts.messages).toEqual([ 'Add environment variables', 'Path to the dotenv file', - 'KEY=VALUE pairs separated by spaces', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")', ]); expect(create.scope.isDone()).toBe(true); expect(create.body()?.environment?.environmentVariables).toEqual([ @@ -959,12 +959,12 @@ describe('integration: launch:projects:create on the wire', () => { 'Add environment variables': [ 'Import variables from a stack', 'Import variables from a dotenv file', - 'Type KEY=VALUE pairs', + 'Manually add custom variables', ], Stack: '0', 'Delivery token': '0', 'Path to the dotenv file': file, - 'KEY=VALUE pairs separated by spaces': 'FROM_FILE=typed EXTRA=1', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'FROM_FILE=typed EXTRA=1', }); stubGitLookups(); const lookups = stubStackPickers(); @@ -979,7 +979,7 @@ describe('integration: launch:projects:create on the wire', () => { 'Stack', 'Delivery token', 'Path to the dotenv file', - 'KEY=VALUE pairs separated by spaces', + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")', ]); expect(lookups.every((scope) => scope.isDone())).toBe(true); expect(create.body()?.environment?.environmentVariables).toEqual([ @@ -997,7 +997,7 @@ describe('integration: launch:projects:create on the wire', () => { it('refuses Skip combined with another source before creating anything', async () => { answerPrompts({ - 'Add environment variables': ['Skip adding environment variables', 'Type KEY=VALUE pairs'], + 'Add environment variables': ['Skip adding environment variables', 'Manually add custom variables'], }); stubGitLookups(); const create = captureBody(); diff --git a/test/integration/variables-set-unset.test.ts b/test/integration/variables-set-unset.test.ts index 97c3935..ab61d9b 100644 --- a/test/integration/variables-set-unset.test.ts +++ b/test/integration/variables-set-unset.test.ts @@ -251,8 +251,8 @@ describe('integration: launch:variables:set and :unset driven through oclif runC const sent = wire(); const scope = patchEndpoint(sent); const prompts = answerPrompts({ - 'Add variables from': ['Type KEY=VALUE pairs'], - 'KEY=VALUE pairs separated by spaces': 'API_URL=typed-value DEBUG=true', + 'Add variables from': ['Manually add custom variables'], + 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")': 'API_URL=typed-value DEBUG=true', }); const { error, stdout } = await onTerminal(() => @@ -260,12 +260,12 @@ describe('integration: launch:variables:set and :unset driven through oclif runC ); expect(error).toBeUndefined(); - expect(prompts.messages).toEqual(['Add variables from', 'KEY=VALUE pairs separated by spaces']); + expect(prompts.messages).toEqual(['Add variables from', 'Enter variables separated by spaces (Ex: KEY1=value1 KEY2:value2 KEY3="value with spaces")']); expect(prompts.payloads[0]).toMatchObject({ type: 'checkbox' }); expect((prompts.payloads[0].choices as { value: string }[]).map((choice) => choice.value)).toEqual([ 'Import variables from a stack', 'Import variables from a dotenv file', - 'Type KEY=VALUE pairs', + 'Manually add custom variables', ]); expect(scope.isDone()).toBe(true); expect(sent.patch).toEqual([ @@ -274,7 +274,8 @@ describe('integration: launch:variables:set and :unset driven through oclif runC ], }, ]); - expect(stdout).toContain('2 variables set \u2014 2 from --var'); + expect(stdout).toContain('2 variables set \u2014 2 from manual entry'); + expect(stdout).not.toContain('--var'); expect(stdout).not.toContain('typed-value'); }); @@ -446,7 +447,7 @@ describe('integration: launch:variables:set and :unset driven through oclif runC expect(error).toBeUndefined(); expect(sent.order).toEqual(['get', 'patch']); expect(sent.patch).toEqual([{ unset: ['key1'] }]); - expect(stdout).toContain('\u2714 key1 removed from production.'); + expect(stdout).toContain('\u2714 Variable key1 removed from the "production" environment.'); expect(stdout).not.toContain('value1'); }); @@ -475,7 +476,7 @@ describe('integration: launch:variables:set and :unset driven through oclif runC it('exits 3 and sends no PATCH when the user declines', async () => { const sent = wire(); unsetEndpoints(sent); - answerPrompts({ 'Are you sure you want to remove key1 from "production"?': false }); + answerPrompts({ 'Are you sure you want to remove the variable key1 from the "production" environment?': false }); const { error, stdout } = await onTerminal(() => runCommand(['launch:variables:unset', ...SCOPE, '--key', 'key1'], config),