From c5cc1ce820a4a9f4845bc001fb4b95c68c5b776e Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Thu, 2 Nov 2023 13:38:25 -0600 Subject: [PATCH] chore: bump testkit, use 'dev' cli --- package.json | 2 +- test/nuts/deployDestructive.nut.ts | 9 +++- .../deb.manifest.nut.ts | 23 ++++++++- .../deb.metadata.nut.ts | 15 ++++++ .../deb.sourcepath.nut.ts | 11 +++++ .../deb.tracking.nut.ts | 15 ++++++ test/nuts/digitalExperienceBundle/helper.ts | 2 + test/nuts/folderTypes.nut.ts | 6 ++- test/nuts/force.nut.ts | 5 +- test/nuts/mdapi.nut.ts | 48 +++++++++++-------- test/nuts/nestedLwc.nut.ts | 9 ++-- test/nuts/partialBundleDelete.nut.ts | 8 ++-- test/nuts/territory2.nut.ts | 33 +++++++++++++ test/nuts/trackingCommands/basics.nut.ts | 10 ++++ test/nuts/trackingCommands/conflicts.nut.ts | 4 +- .../nuts/trackingCommands/customLabels.nut.ts | 7 +-- .../deployRetrieveDelete.nut.ts | 10 ++++ test/nuts/trackingCommands/forceIgnore.nut.ts | 6 +++ test/nuts/trackingCommands/lwc.nut.ts | 9 ++++ .../mpd-non-sequential.nut.ts | 1 + .../trackingCommands/mpd-sequential.nut.ts | 1 + .../trackingCommands/remoteChanges.nut.ts | 13 ++++- test/nuts/translation.nut.ts | 18 ++++++- yarn.lock | 8 ++-- 24 files changed, 226 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 507951a28..8b1234a5f 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@oclif/plugin-command-snapshot": "^5.0.1", "@oclif/plugin-help": "^6.0.5", - "@salesforce/cli-plugins-testkit": "^5.0.0-dev.2", + "@salesforce/cli-plugins-testkit": "^5.0.0", "@salesforce/dev-scripts": "^6.0.3", "@salesforce/plugin-command-reference": "^3.0.25", "@salesforce/plugin-deploy-retrieve": "^1.19.3", diff --git a/test/nuts/deployDestructive.nut.ts b/test/nuts/deployDestructive.nut.ts index b63314c6f..2ae33a7be 100644 --- a/test/nuts/deployDestructive.nut.ts +++ b/test/nuts/deployDestructive.nut.ts @@ -21,14 +21,16 @@ describe('source:deploy --destructive NUTs', () => { const pathToClass = path.join(testkit.projectDir, output, `${apexName}.cls`); execCmd(`force:apex:class:create --classname ${apexName} --outputdir ${output} --api-version 58.0`, { ensureExitCode: 0, + cli: 'dev', }); - execCmd(`force:source:deploy -m ApexClass:${apexName}`, { ensureExitCode: 0 }); + execCmd(`force:source:deploy -m ApexClass:${apexName}`, { ensureExitCode: 0, cli: 'dev' }); return { apexName, output, pathToClass }; }; const createManifest = (metadata: string, manifesttype: string) => { execCmd(`force:source:manifest:create --metadata ${metadata} --manifesttype ${manifesttype} --api-version 58.0`, { ensureExitCode: 0, + cli: 'dev', }); }; @@ -37,7 +39,7 @@ describe('source:deploy --destructive NUTs', () => { nut: fileURLToPath(import.meta.url), repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git', }); - execCmd('force:source:deploy --sourcepath force-app', { ensureExitCode: 0 }); + execCmd('force:source:deploy --sourcepath force-app', { ensureExitCode: 0, cli: 'dev' }); }); after(async () => { @@ -55,6 +57,7 @@ describe('source:deploy --destructive NUTs', () => { execCmd('force:source:deploy --json --manifest package.xml --postdestructivechanges destructiveChangesPost.xml', { ensureExitCode: 0, + cli: 'dev', }); deleted = await isNameObsolete(testkit.username, 'ApexClass', apexName); @@ -73,6 +76,7 @@ describe('source:deploy --destructive NUTs', () => { execCmd('force:source:deploy --json --manifest package.xml --predestructivechanges destructiveChangesPre.xml', { ensureExitCode: 0, + cli: 'dev', }); deleted = await isNameObsolete(testkit.username, 'ApexClass', apexName); @@ -99,6 +103,7 @@ describe('source:deploy --destructive NUTs', () => { 'force:source:deploy --json --manifest package.xml --postdestructivechanges destructiveChangesPost.xml --predestructivechanges destructiveChangesPre.xml', { ensureExitCode: 0, + cli: 'dev', } ); diff --git a/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts b/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts index 2034c2e8b..e599d679a 100644 --- a/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.manifest.nut.ts @@ -41,7 +41,7 @@ describe('deb -- manifest option', () => { it('should generate manifest for all debs using sourcepath', () => { execCmd( `force:source:manifest:create --sourcepath ${DEBS_RELATIVE_PATH} --name ${STORE.MANIFESTS.ALL_DEBS_SOURCE_PATH_GEN} --json`, - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ); expect(fs.existsSync(join(session.project.dir, STORE.MANIFESTS.ALL_DEBS_SOURCE_PATH_GEN))).to.be.true; }); @@ -49,7 +49,7 @@ describe('deb -- manifest option', () => { it('should generate manifest for all debs using metadata', () => { execCmd( `force:source:manifest:create --metadata ${METADATA.ALL_DEBS} --name ${STORE.MANIFESTS.ALL_DEBS_METADATA_GEN} --json`, - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ); expect(fs.existsSync(join(session.project.dir, STORE.MANIFESTS.ALL_DEBS_METADATA_GEN))).to.be.true; }); @@ -61,6 +61,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --metadata ${TYPES.APEX_PAGE.name},${TYPES.APEX_CLASS.name} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -70,6 +71,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.FULL_SITE_DEB_A_AND_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -82,6 +84,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.ALL_DEBS} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -93,6 +96,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.ALL_DE} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -106,6 +110,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.ALL_DE_OF_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -117,6 +122,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.JUST_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -128,6 +134,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.DE_VIEW_HOME_OF_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -141,6 +148,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.ALL_DEBS_SOURCE_PATH_GEN} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -152,6 +160,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.ALL_DEBS_METADATA_GEN} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -171,6 +180,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.ALL_DEBS} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -182,6 +192,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.ALL_DE} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -195,6 +206,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.ALL_DE_OF_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -206,6 +218,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.JUST_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -217,6 +230,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.DE_VIEW_HOME_OF_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -230,6 +244,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.ALL_DEBS_SOURCE_PATH_GEN} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -241,6 +256,7 @@ describe('deb -- manifest option', () => { `force:source:retrieve --manifest ${STORE.MANIFESTS.ALL_DEBS_METADATA_GEN} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -257,6 +273,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.DE_VIEW_HOME_OF_DEB_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -272,6 +289,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.DE_DOCUMENT_DETAIL_PAGE_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -283,6 +301,7 @@ describe('deb -- manifest option', () => { `force:source:deploy --manifest ${STORE.MANIFESTS.EMPTY_PACKAGE_XML} --predestructivechanges ${STORE.MANIFESTS.DE_DOCUMENT_DETAIL_PAGE_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; diff --git a/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts b/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts index 5177339d3..2b271ab8c 100644 --- a/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.metadata.nut.ts @@ -40,6 +40,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${TYPES.APEX_PAGE.name},${TYPES.APEX_CLASS.name} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -49,6 +50,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.FULL_SITE_DEB_A_AND_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -61,6 +63,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.ALL_DEBS} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -72,6 +75,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.ALL_DE} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -85,6 +89,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.ALL_DE_OF_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -96,6 +101,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.JUST_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -107,6 +113,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.DE_VIEW_HOME_OF_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -126,6 +133,7 @@ describe('deb -- metadata option', () => { `force:source:retrieve --metadata ${METADATA.ALL_DEBS} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -137,6 +145,7 @@ describe('deb -- metadata option', () => { `force:source:retrieve --metadata ${METADATA.ALL_DE} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -150,6 +159,7 @@ describe('deb -- metadata option', () => { `force:source:retrieve --metadata ${METADATA.ALL_DE_OF_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -161,6 +171,7 @@ describe('deb -- metadata option', () => { `force:source:retrieve --metadata ${METADATA.JUST_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -172,6 +183,7 @@ describe('deb -- metadata option', () => { `force:source:retrieve --metadata ${METADATA.DE_VIEW_HOME_OF_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -188,6 +200,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.DE_VIEW_HOME_OF_DEB_B} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -203,6 +216,7 @@ describe('deb -- metadata option', () => { `force:source:deploy --metadata ${METADATA.DE_DOCUMENT_DETAIL_PAGE_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -214,6 +228,7 @@ describe('deb -- metadata option', () => { `force:source:delete --metadata ${METADATA.DE_DOCUMENT_DETAIL_PAGE_A} --noprompt --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deletedSource; diff --git a/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts b/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts index e9cfc76c4..f88498c41 100644 --- a/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts @@ -43,6 +43,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --metadata ${TYPES.APEX_PAGE.name},${TYPES.APEX_CLASS.name} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -52,6 +53,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DEBS_RELATIVE_PATH},${DIR_RELATIVE_PATHS.DIGITAL_EXPERIENCE_CONFIGS},${DIR_RELATIVE_PATHS.NETWORKS},${DIR_RELATIVE_PATHS.SITES} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -64,6 +66,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DEBS_RELATIVE_PATH} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -77,6 +80,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DEB_A_RELATIVE_PATH} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -88,6 +92,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DIR_RELATIVE_PATHS.DE_VIEW_HOME_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -103,6 +108,7 @@ describe('deb -- sourcepath option', () => { `force:source:retrieve --sourcepath ${DEBS_RELATIVE_PATH} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -116,6 +122,7 @@ describe('deb -- sourcepath option', () => { `force:source:retrieve --sourcepath ${DEB_A_RELATIVE_PATH} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -127,6 +134,7 @@ describe('deb -- sourcepath option', () => { `force:source:retrieve --sourcepath ${DIR_RELATIVE_PATHS.DE_VIEW_HOME_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -143,6 +151,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DIR_RELATIVE_PATHS.DE_VIEW_HOME_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -158,6 +167,7 @@ describe('deb -- sourcepath option', () => { `force:source:deploy --sourcepath ${DIR_RELATIVE_PATHS.DE_VIEW_DOCUMENT_DETAIL_A},${DIR_RELATIVE_PATHS.DE_ROUTE_DOCUMENT_DETAIL_A} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deployedSource; @@ -169,6 +179,7 @@ describe('deb -- sourcepath option', () => { `force:source:delete --sourcepath ${DIR_RELATIVE_PATHS.DE_VIEW_DOCUMENT_DETAIL_A},${DIR_RELATIVE_PATHS.DE_ROUTE_DOCUMENT_DETAIL_A} --noprompt --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.deletedSource; diff --git a/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts b/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts index d768019ed..b4e902e53 100644 --- a/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts +++ b/test/nuts/digitalExperienceBundle/deb.tracking.nut.ts @@ -41,6 +41,7 @@ describe('deb -- tracking/push/pull', () => { it('should push the whole project', () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertAllDEBAndTheirDECounts(pushedSource, 10); @@ -53,6 +54,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertDEBMeta(statusResult, 'B'); @@ -61,6 +63,7 @@ describe('deb -- tracking/push/pull', () => { it('should push local change in deb_b', () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertDEBMeta(pushedSource, 'B'); @@ -77,6 +80,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertViewHomeStatus(statusResult, 'B', 'CONTENT'); @@ -85,6 +89,7 @@ describe('deb -- tracking/push/pull', () => { it('should push local change in de_view_home_content of deb_b', () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertViewHome(pushedSource, 'B'); @@ -100,6 +105,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertViewHomeStatus(statusResult, 'B', 'META'); @@ -108,6 +114,7 @@ describe('deb -- tracking/push/pull', () => { it('should push local change in de_view_home_meta of deb_b', () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertViewHome(pushedSource, 'B'); @@ -119,10 +126,12 @@ describe('deb -- tracking/push/pull', () => { it('should pull all debs after clearing source tracking info', () => { execCmd('force:source:tracking:clear --noprompt', { ensureExitCode: 0, + cli: 'dev', }); const pulledSource = execCmd('force:source:pull --forceoverwrite --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result?.pulledSource; assertAllDEBAndTheirDECounts(pulledSource, 0, false); @@ -131,6 +140,7 @@ describe('deb -- tracking/push/pull', () => { it('should not see any local/remote changes in deb/de', () => { const statusResult = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(statusResult?.every((s) => s.type !== TYPES.DE?.name && s.type !== TYPES.DEB.name)).to.be.true; @@ -143,6 +153,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertViewHomeStatus(statusResult, 'B', 'FR_VARIANT'); @@ -159,6 +170,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertDocumentDetailPageA(statusResult); @@ -167,6 +179,7 @@ describe('deb -- tracking/push/pull', () => { it('should push locally added page (view and route de components) in deb_a', () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertDocumentDetailPageA(pushedSource); @@ -178,6 +191,7 @@ describe('deb -- tracking/push/pull', () => { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; assertDocumentDetailPageA(statusResult); @@ -186,6 +200,7 @@ describe('deb -- tracking/push/pull', () => { it('should push local delete change in deb_a [locally deleted page (view and route de components)]', async () => { const pushedSource = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; assertDocumentDetailPageA(pushedSource); diff --git a/test/nuts/digitalExperienceBundle/helper.ts b/test/nuts/digitalExperienceBundle/helper.ts index 5bfd700af..bd7eff5ac 100644 --- a/test/nuts/digitalExperienceBundle/helper.ts +++ b/test/nuts/digitalExperienceBundle/helper.ts @@ -191,6 +191,7 @@ export function assertViewHomeFRVariantDelete( `force:source:retrieve --manifest ${DEBS[deb].DE.VIEW_HOME.MANIFEST} --json`, { ensureExitCode: 0, + cli: 'dev', } ).jsonOutput?.result.inboundFiles; @@ -201,6 +202,7 @@ export function assertViewHomeFRVariantDelete( export function assertNoLocalChanges() { const statusResult = execCmd('force:source:status --local --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(statusResult).to.deep.equal([]); } diff --git a/test/nuts/folderTypes.nut.ts b/test/nuts/folderTypes.nut.ts index 12e432740..00e6b0655 100644 --- a/test/nuts/folderTypes.nut.ts +++ b/test/nuts/folderTypes.nut.ts @@ -83,6 +83,7 @@ describe('metadata types that go in folders', () => { const pathToEmails = path.join('force-app', 'main', 'default', 'email'); execCmd(`force:source:manifest:create -p ${pathToEmails} --json`, { ensureExitCode: 0, + cli: 'dev', }); expect(fs.existsSync(path.join(session.project.dir, 'package.xml'))).to.be.true; }); @@ -112,16 +113,17 @@ describe('metadata types that go in folders', () => { const pathToReports = path.join('force-app', 'main', 'default', 'reports'); execCmd(`force:source:manifest:create -p ${pathToReports} --json`, { ensureExitCode: 0, + cli: 'dev', }); expect(fs.existsSync(path.join(session.project.dir, 'package.xml'))).to.be.true; }); it('can deploy reports via the manifest', () => { - execCmd('force:source:deploy -x package.xml --json', { ensureExitCode: 0 }); + execCmd('force:source:deploy -x package.xml --json', { ensureExitCode: 0, cli: 'dev' }); }); it('can retrieve reports via the manifest', () => { - execCmd('force:source:retrieve -x package.xml --json', { ensureExitCode: 0 }); + execCmd('force:source:retrieve -x package.xml --json', { ensureExitCode: 0, cli: 'dev' }); }); }); }); diff --git a/test/nuts/force.nut.ts b/test/nuts/force.nut.ts index 038244085..b99cb62fe 100644 --- a/test/nuts/force.nut.ts +++ b/test/nuts/force.nut.ts @@ -20,13 +20,14 @@ describe('force command', () => { }); }); it('returns an apiVersion in JSON', () => { - const result = execCmd<{ apiVersion: string }>('force --json', { ensureExitCode: 0 }).jsonOutput?.result; + const result = execCmd<{ apiVersion: string }>('force --json', { ensureExitCode: 0, cli: 'dev' }).jsonOutput + ?.result; expect(result).to.be.an('object').that.has.all.keys('apiVersion'); expect(result?.apiVersion).to.match(/^\d{2,}\.0$/); expect(parseInt(result?.apiVersion ?? '', 10)).to.be.greaterThan(53); }); it('executes the cloud/links without JSON', () => { - const result = execCmd('force', { ensureExitCode: 0 }).shellOutput as string; + const result = execCmd('force', { ensureExitCode: 0, cli: 'dev' }).shellOutput as string; expect(result).to.include('Salesforce CLI Release Notes'); }); diff --git a/test/nuts/mdapi.nut.ts b/test/nuts/mdapi.nut.ts index 47b3ebdb8..4827d75cc 100644 --- a/test/nuts/mdapi.nut.ts +++ b/test/nuts/mdapi.nut.ts @@ -63,9 +63,10 @@ describe('1k files in mdapi:deploy', () => { }); it('should be able to handle a mdapi:deploy of 1k', () => { - execCmd('force:source:convert --outputdir mdapiFormat', { ensureExitCode: 0 }); + execCmd('force:source:convert --outputdir mdapiFormat', { ensureExitCode: 0, cli: 'dev' }); const res = execCmd<{ checkOnly: boolean; done: boolean }>('force:mdapi:deploy -d mdapiFormat -w 100 --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput; expect(res?.status).to.equal(0); // check that the deploy actually happened, not just based on the exit code, otherwise something like @@ -93,7 +94,7 @@ describe('mdapi NUTs', () => { ], }); - execCmd('force:source:deploy -p force-app', { ensureExitCode: 0 }); + execCmd('force:source:deploy -p force-app', { ensureExitCode: 0, cli: 'dev' }); execCmd('force:user:permset:assign -n dreamhouse', { cli: 'sfdx', ensureExitCode: 0 }); process.env.SFDX_USE_PROGRESS_BAR = 'false'; @@ -128,9 +129,10 @@ describe('mdapi NUTs', () => { it('will cancel an mdapi deploy via the stash.json', () => { const convertDir = 'mdConvert1'; - execCmd(`force:source:convert --outputdir ${convertDir}`, { ensureExitCode: 0 }); + execCmd(`force:source:convert --outputdir ${convertDir}`, { ensureExitCode: 0, cli: 'dev' }); const deploy = execCmd<{ id: string }>(`force:mdapi:deploy -d ${convertDir} -w 0 --json`, { ensureExitCode: 0, + cli: 'dev', }).jsonOutput; const result = execCmd('force:mdapi:deploy:cancel --json'); cancelAssertions(deploy?.result?.id, result); @@ -138,9 +140,10 @@ describe('mdapi NUTs', () => { it('will cancel an mdapi deploy via the specified deploy id', () => { const convertDir = 'mdConvert2'; - execCmd(`force:source:convert --outputdir ${convertDir}`, { ensureExitCode: 0 }); + execCmd(`force:source:convert --outputdir ${convertDir}`, { ensureExitCode: 0, cli: 'dev' }); const deploy = execCmd<{ id: string }>(`force:mdapi:deploy -d ${convertDir} -w 0 --json`, { ensureExitCode: 0, + cli: 'dev', }).jsonOutput; const result = execCmd('force:mdapi:deploy:cancel --json'); cancelAssertions(deploy?.result?.id, result); @@ -159,8 +162,8 @@ describe('mdapi NUTs', () => { expect(rv.code, 'Failed to install ElectronBranding package for tests').to.equal(0); // Create manifests for retrieve commands to use - execCmd(`force:source:manifest:create -p force-app -n ${manifestPath}`, { ensureExitCode: 0 }); - execCmd(`force:source:manifest:create -m ApexClass -n ${apexManifestPath}`, { ensureExitCode: 0 }); + execCmd(`force:source:manifest:create -p force-app -n ${manifestPath}`, { ensureExitCode: 0, cli: 'dev' }); + execCmd(`force:source:manifest:create -m ApexClass -n ${apexManifestPath}`, { ensureExitCode: 0, cli: 'dev' }); }); describe('mdapi:retrieve (sync)', () => { @@ -168,7 +171,7 @@ describe('mdapi NUTs', () => { const retrieveTargetDir = 'mdRetrieveFromManifest'; const retrieveTargetDirPath = path.join(session.project.dir, retrieveTargetDir); const cmd = `force:mdapi:retrieve -w 10 -r ${retrieveTargetDir} -k ${manifestPath} --json`; - const rv = execCmd(cmd, { ensureExitCode: 0 }); + const rv = execCmd(cmd, { ensureExitCode: 0, cli: 'dev' }); // Verify unpackaged.zip exists in retrieveTargetDir const retrievedZip = fs.existsSync(retrieveTargetDirPath); @@ -193,7 +196,7 @@ describe('mdapi NUTs', () => { ); const retrieveTargetDir = 'mdRetrieveFromManifest'; const cmd = `force:mdapi:retrieve -w 10 -r ${retrieveTargetDir} -k ${manifestPath}`; - const rv = execCmd(cmd, { ensureExitCode: 0 }).shellOutput; + const rv = execCmd(cmd, { ensureExitCode: 0, cli: 'dev' }).shellOutput; expect(rv.stdout).to.include(`Retrieving v${targetApiVersion} metadata from`); }); @@ -201,7 +204,7 @@ describe('mdapi NUTs', () => { const retrieveTargetDir = 'mdRetrieveSinglePackage'; const retrieveTargetDirPath = path.join(session.project.dir, retrieveTargetDir); const cmd = `force:mdapi:retrieve -w 10 -r ${retrieveTargetDir} -p ${ELECTRON.name} --json`; - const rv = execCmd(cmd, { ensureExitCode: 0 }); + const rv = execCmd(cmd, { ensureExitCode: 0, cli: 'dev' }); // Verify unpackaged.zip exists in retrieveTargetDir const retrievedZip = fs.existsSync(retrieveTargetDirPath); @@ -220,7 +223,7 @@ describe('mdapi NUTs', () => { const retrieveTargetDir = 'mdRetrieveNamedZipAndUnzip'; const retrieveTargetDirPath = path.join(session.project.dir, retrieveTargetDir); const cmd = `force:mdapi:retrieve -w 10 -r ${retrieveTargetDir} -k ${apexManifestPath} -z -n ${zipName} --json`; - const rv = execCmd(cmd, { ensureExitCode: 0 }); + const rv = execCmd(cmd, { ensureExitCode: 0, cli: 'dev' }); // Verify apexClasses.zip exists in retrieveTargetDir const retrievedZip = fs.existsSync(path.join(retrieveTargetDirPath, zipName)); @@ -244,7 +247,7 @@ describe('mdapi NUTs', () => { const retrieveTargetDir = 'mdRetrieveReportAsync'; const retrieveTargetDirPath = path.join(session.project.dir, retrieveTargetDir); const retrieveCmd = `force:mdapi:retrieve -r ${retrieveTargetDir} -k ${manifestPath} --json -w 0`; - const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0 }); + const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0, cli: 'dev' }); expect(rv1.jsonOutput, JSON.stringify(rv1)).to.exist; const result1 = rv1.jsonOutput?.result; @@ -256,7 +259,7 @@ describe('mdapi NUTs', () => { // Async report, from stash let reportCmd = 'force:mdapi:retrieve:report -w 0 --json'; - const rv2 = execCmd(reportCmd, { ensureExitCode: 0 }); + const rv2 = execCmd(reportCmd, { ensureExitCode: 0, cli: 'dev' }); const result2 = rv2.jsonOutput?.result; let syncResult: RetrieveCommandResult | undefined; @@ -275,7 +278,7 @@ describe('mdapi NUTs', () => { // Now sync report, from stash reportCmd = 'force:mdapi:retrieve:report -w 10 --json'; - const rv3 = execCmd(reportCmd, { ensureExitCode: 0 }); + const rv3 = execCmd(reportCmd, { ensureExitCode: 0, cli: 'dev' }); syncResult = rv3.jsonOutput?.result; } expect(syncResult?.status).to.equal(RequestStatus.Succeeded); @@ -287,7 +290,7 @@ describe('mdapi NUTs', () => { it('retrieves report (sync) with overrides of stash', () => { const retrieveCmd = `force:mdapi:retrieve -r mdRetrieveReportTmp -k ${manifestPath} --json -w 0`; - const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0 }); + const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0, cli: 'dev' }); expect(rv1.jsonOutput, JSON.stringify(rv1)).to.exist; const result1 = rv1.jsonOutput?.result; @@ -299,7 +302,7 @@ describe('mdapi NUTs', () => { const extractPath = path.join(retrieveTargetDirPath, name); const reportCmd = `force:mdapi:retrieve:report -i ${result1?.id} -z -n ${zipName} -r ${retrieveTargetDir} --json`; - const rv2 = execCmd(reportCmd, { ensureExitCode: 0 }); + const rv2 = execCmd(reportCmd, { ensureExitCode: 0, cli: 'dev' }); expect(rv2.jsonOutput, JSON.stringify(rv2)).to.exist; const result2 = rv2.jsonOutput?.result; @@ -323,13 +326,13 @@ describe('mdapi NUTs', () => { const retrieveTargetDirPath = path.join(session.project.dir, retrieveTargetDir); const extractPath = path.join(retrieveTargetDirPath, name); const retrieveCmd = `force:mdapi:retrieve -r ${retrieveTargetDir} -k ${manifestPath} -z -n ${zipName} --json -w 0`; - const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0 }); + const rv1 = execCmd(retrieveCmd, { ensureExitCode: 0, cli: 'dev' }); expect(rv1.jsonOutput, JSON.stringify(rv1)).to.exist; const result1 = rv1.jsonOutput?.result; const reportCmd = 'force:mdapi:retrieve:report --json'; - const rv2 = execCmd(reportCmd, { ensureExitCode: 0 }); + const rv2 = execCmd(reportCmd, { ensureExitCode: 0, cli: 'dev' }); expect(rv2.jsonOutput, JSON.stringify(rv2)).to.exist; const result2 = rv2.jsonOutput?.result; @@ -352,7 +355,7 @@ describe('mdapi NUTs', () => { before(async () => { const mdapiOut = 'mdapiOut'; // make a mdapi directory from the project - execCmd(`force:source:convert -p force-app --outputdir ${mdapiOut}`, { ensureExitCode: 0 }); + execCmd(`force:source:convert -p force-app --outputdir ${mdapiOut}`, { ensureExitCode: 0, cli: 'dev' }); // make a zip from that const zip = create('zip', { zlib: { level: 9 } }); const output = fs.createWriteStream(path.join(session.project.dir, `${mdapiOut}.zip`)); @@ -369,6 +372,7 @@ describe('mdapi NUTs', () => { 'force:mdapi:deploy --zipfile mdapiOut.zip --json --soapdeploy -u nonDefaultOrg --testlevel RunAllTestsInOrg', { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -391,6 +395,7 @@ describe('mdapi NUTs', () => { it('request non-verbose deploy report without a deployId', () => { const reportCommandResponse = execCmd('force:mdapi:deploy:report --wait 200 -u nonDefaultOrg', { ensureExitCode: 0, + cli: 'dev', }).shellOutput.stdout; // this output is a change from mdapi:deploy:report which returned NOTHING after the progress bar @@ -403,6 +408,7 @@ describe('mdapi NUTs', () => { 'force:mdapi:deploy:report --wait 200 -u nonDefaultOrg --verbose --coverageformatters clover --junit --resultsdir resultsdir', { ensureExitCode: 0, + cli: 'dev', } ).shellOutput.stdout; // has the basic table output @@ -416,6 +422,7 @@ describe('mdapi NUTs', () => { it('async report without a deployId', () => { const reportCommandResponse = execCmd('force:mdapi:deploy:report --wait 0 -u nonDefaultOrg', { ensureExitCode: 0, + cli: 'dev', }).shellOutput.stdout; // this output is a change from mdapi:deploy:report which returned NOTHING after the progress bar @@ -429,7 +436,7 @@ describe('mdapi NUTs', () => { it('should deploy a directory', () => { deployCommandResponse = execCmd( 'force:mdapi:deploy --deploydir mdapiOut --json --soapdeploy', - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ).jsonOutput?.result; }); it('should fail report', () => { @@ -446,7 +453,7 @@ describe('mdapi NUTs', () => { it('should check-only deploy a directory with tests', () => { deployCommandResponse = execCmd( 'force:mdapi:deploy --deploydir mdapiOut --json --soapdeploy --checkonly --testlevel RunAllTestsInOrg --wait 100', - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ).jsonOutput?.result; }); it('should deploy validated Id', () => { @@ -454,6 +461,7 @@ describe('mdapi NUTs', () => { `force:mdapi:deploy --wait -1 --validateddeployrequestid ${deployCommandResponse?.id} --ignorewarnings -o`, { ensureExitCode: 0, + cli: 'dev', } ); }); diff --git a/test/nuts/nestedLwc.nut.ts b/test/nuts/nestedLwc.nut.ts index 27dc025b7..aa0ca1855 100644 --- a/test/nuts/nestedLwc.nut.ts +++ b/test/nuts/nestedLwc.nut.ts @@ -30,14 +30,17 @@ describe('Nested LWCs', () => { }); it('pushes nested LWC', () => { - const pushResults = execCmd('force:source:push --json', { ensureExitCode: 0 }).jsonOutput?.result; + const pushResults = execCmd('force:source:push --json', { ensureExitCode: 0, cli: 'dev' }).jsonOutput + ?.result; expect(pushResults?.pushedSource.some((r) => r.fullName === 'cmpA')).to.be.true; expect(pushResults?.pushedSource.some((r) => r.fullName === 'cmpB')).to.be.true; }); it('deploys nested LWC', () => { - const deployResults = execCmd('force:source:deploy --json -p force-app', { ensureExitCode: 0 }) - .jsonOutput?.result; + const deployResults = execCmd('force:source:deploy --json -p force-app', { + ensureExitCode: 0, + cli: 'dev', + }).jsonOutput?.result; expect(deployResults?.deployedSource.some((r) => r.fullName === 'cmpA')).to.be.true; expect(deployResults?.deployedSource.some((r) => r.fullName === 'cmpB')).to.be.true; }); diff --git a/test/nuts/partialBundleDelete.nut.ts b/test/nuts/partialBundleDelete.nut.ts index 90b74e057..d14a920ae 100644 --- a/test/nuts/partialBundleDelete.nut.ts +++ b/test/nuts/partialBundleDelete.nut.ts @@ -125,7 +125,7 @@ describe('Partial Bundle Delete Retrieves', () => { auraSrcDir = path.join(dreamhouseProj.dir, 'force-app', 'main', 'default', 'aura'); lwcSrcDir = path.join(dreamhouseProj.dir, 'force-app', 'main', 'default', 'lwc'); - execCmd(`force:source:deploy -p force-app -u ${scratchOrgUsername}`, { ensureExitCode: 0 }); + execCmd(`force:source:deploy -p force-app -u ${scratchOrgUsername}`, { ensureExitCode: 0, cli: 'dev' }); }); // This test uses the dreamhouse-lwc repo to add a CSS file to an aura @@ -142,7 +142,7 @@ describe('Partial Bundle Delete Retrieves', () => { const result = execCmd( `force:source:retrieve -p ${pageTemplatePath} -u ${scratchOrgUsername} --json`, - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ); expect(fs.existsSync(testCssFile)).to.be.false; @@ -175,7 +175,7 @@ describe('Partial Bundle Delete Retrieves', () => { const result = execCmd( `force:source:retrieve -p ${propertyTilePath} -u ${scratchOrgUsername} --json`, - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ); expect(fs.existsSync(testCssFile)).to.be.false; @@ -204,7 +204,7 @@ describe('Partial Bundle Delete Retrieves', () => { const result = execCmd( `force:source:retrieve -p ${brokerCardPath} -u ${scratchOrgUsername} --json`, - { ensureExitCode: 0 } + { ensureExitCode: 0, cli: 'dev' } ); expect(fs.existsSync(testsDir)).to.be.true; diff --git a/test/nuts/territory2.nut.ts b/test/nuts/territory2.nut.ts index 262e3616b..05d2f4c44 100644 --- a/test/nuts/territory2.nut.ts +++ b/test/nuts/territory2.nut.ts @@ -46,6 +46,7 @@ describe('territories', () => { it('can generate manifest for territory types', () => { execCmd('force:source:manifest:create -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); expect(fs.existsSync(path.join(session.project.dir, 'package.xml'))).to.be.true; }); @@ -53,6 +54,7 @@ describe('territories', () => { it('deploy', () => { const deployResults = execCmd('force:source:deploy -x package.xml --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(deployResults?.deployedSource.length).to.equal(8); }); @@ -63,6 +65,7 @@ describe('territories', () => { await fs.promises.mkdir(path.join(session.project.dir, 'force-app')); const retrieveResults = execCmd('force:source:retrieve -x package.xml --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(retrieveResults?.inboundFiles).to.have.length(8); }); @@ -73,6 +76,7 @@ describe('territories', () => { it('can deploy all metadata items', () => { execCmd('force:source:deploy -m Territory2,Territory2Model,Territory2Rule,Territory2Type --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -80,24 +84,28 @@ describe('territories', () => { it('can deploy Territory2Model', () => { execCmd('force:source:deploy -m Territory2Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2Rule', () => { execCmd('force:source:deploy -m Territory2Rule --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2Type', () => { execCmd('force:source:deploy -m Territory2Type --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2', () => { execCmd('force:source:deploy -m Territory2 --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -106,18 +114,21 @@ describe('territories', () => { it('can deploy Territory2Model', () => { execCmd('force:source:deploy -m Territory2Model:SCW_Territory_Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2Rule', () => { execCmd('force:source:deploy -m Territory2Rule:SCW_Territory_Model.Fishing_Stores --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2', () => { execCmd('force:source:deploy -m Territory2:SCW_Territory_Model.Austin --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -127,6 +138,7 @@ describe('territories', () => { it('can retrieve all metadata items', () => { execCmd('force:source:retrieve -m Territory2,Territory2Model,Territory2Rule,Territory2Type --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -134,24 +146,28 @@ describe('territories', () => { it('can retrieve Territory2Model', () => { execCmd('force:source:retrieve -m Territory2Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can retrieve Territory2Rule', () => { execCmd('force:source:retrieve -m Territory2Rule --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can retrieve Territory2Type', () => { execCmd('force:source:retrieve -m Territory2Type --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can retrieve Territory2', () => { execCmd('force:source:retrieve -m Territory2 --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -160,18 +176,21 @@ describe('territories', () => { it('can deploy Territory2Model', () => { execCmd('force:source:deploy -m Territory2Model:SCW_Territory_Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2Rule', () => { execCmd('force:source:deploy -m Territory2Rule:SCW_Territory_Model.Fishing_Stores --json', { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2', () => { execCmd('force:source:deploy -m Territory2:SCW_Territory_Model.Austin --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -183,6 +202,7 @@ describe('territories', () => { it('can deploy the whole project', () => { execCmd('force:source:deploy -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -190,18 +210,21 @@ describe('territories', () => { it('can deploy Territory2Rule', () => { execCmd(`force:source:deploy -p ${path.join(modelPath, 'rules')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2Type', () => { execCmd(`force:source:deploy -p ${path.join(projectPath, 'territory2Types')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); it('can deploy Territory2', () => { execCmd(`force:source:deploy -p ${path.join(modelPath, 'territories')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -210,6 +233,7 @@ describe('territories', () => { it('can deploy Territory2Model', () => { execCmd('force:source:deploy -m Territory2Model:SCW_Territory_Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -218,6 +242,7 @@ describe('territories', () => { `force:source:deploy -p ${path.join(modelPath, 'rules', 'Fishing_Stores.territory2Rule-meta.xml')} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -227,6 +252,7 @@ describe('territories', () => { `force:source:deploy -p ${path.join(modelPath, 'territories', 'Austin.territory2-meta.xml')} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -237,6 +263,7 @@ describe('territories', () => { it('can retrieve the whole project', () => { execCmd('force:source:retrieve -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -244,18 +271,21 @@ describe('territories', () => { it('can retrieve Territory2Rule', () => { execCmd(`force:source:retrieve -p ${path.join(modelPath, 'rules')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); it('can retrieve Territory2Type', () => { execCmd(`force:source:retrieve -p ${path.join(projectPath, 'territory2Types')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); it('can retrieve Territory2', () => { execCmd(`force:source:retrieve -p ${path.join(modelPath, 'territories')} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -264,6 +294,7 @@ describe('territories', () => { it('can retrieve Territory2Model', () => { execCmd('force:source:retrieve -m Territory2Model:SCW_Territory_Model --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -276,6 +307,7 @@ describe('territories', () => { )} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -285,6 +317,7 @@ describe('territories', () => { `force:source:retrieve -p ${path.join(modelPath, 'territories', 'Austin.territory2-meta.xml')} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); diff --git a/test/nuts/trackingCommands/basics.nut.ts b/test/nuts/trackingCommands/basics.nut.ts index 223131b74..780fbef40 100644 --- a/test/nuts/trackingCommands/basics.nut.ts +++ b/test/nuts/trackingCommands/basics.nut.ts @@ -49,6 +49,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('detects the initial metadata status', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result).to.be.an.instanceof(Array); // the fields should be populated @@ -68,11 +69,13 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local changes (all were committed from push), but profile updated in remote', () => { const localResult = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(localResult?.filter(filterIgnored)).to.deep.equal([]); const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(remoteResult?.some((item) => item.type === 'Profile')).to.equal(true); }); @@ -80,6 +83,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('can pull the remote profile', () => { const pullResult = execCmd('force:source:pull --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( pullResult?.pulledSource?.some((item) => item?.type === 'Profile'), @@ -90,6 +94,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local or remote changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.filter((r) => r.type === 'Profile').filter(filterIgnored), JSON.stringify(result)).to.have.length( 0 @@ -104,6 +109,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { ]); const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.filter(filterIgnored)).to.deep.equal([ { @@ -129,6 +135,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('does not see any change in remote status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( result?.filter((r) => r.fullName === 'TestOrderController'), @@ -139,12 +146,14 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('pushes the local delete to the org', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; expect(result, JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); }); it('sees no local changes', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.filter(filterIgnored), JSON.stringify(result)).to.be.an.instanceof(Array).with.length(0); }); @@ -217,6 +226,7 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.filter(filterIgnored), JSON.stringify(result)).to.be.an.instanceof(Array).with.length(2); }); diff --git a/test/nuts/trackingCommands/conflicts.nut.ts b/test/nuts/trackingCommands/conflicts.nut.ts index 25dffc532..cd7589632 100644 --- a/test/nuts/trackingCommands/conflicts.nut.ts +++ b/test/nuts/trackingCommands/conflicts.nut.ts @@ -74,6 +74,7 @@ describe('conflict detection and resolution', () => { }); const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( result?.filter((r) => r.type === 'CustomApplication'), @@ -97,6 +98,7 @@ describe('conflict detection and resolution', () => { it('can see the conflict in status', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.filter((app) => app.type === 'CustomApplication'); // json is not sorted. This relies on the implementation of getConflicts() expect(result).to.deep.equal([ @@ -157,6 +159,6 @@ describe('conflict detection and resolution', () => { execCmd('force:source:pull --json', { ensureExitCode: 1 }); }); it('can push with forceoverwrite', () => { - execCmd('force:source:push --json --forceoverwrite', { ensureExitCode: 0 }); + execCmd('force:source:push --json --forceoverwrite', { ensureExitCode: 0, cli: 'dev' }); }); }); diff --git a/test/nuts/trackingCommands/customLabels.nut.ts b/test/nuts/trackingCommands/customLabels.nut.ts index 86d9a6e2f..bd26c5518 100644 --- a/test/nuts/trackingCommands/customLabels.nut.ts +++ b/test/nuts/trackingCommands/customLabels.nut.ts @@ -37,7 +37,7 @@ describe('CustomLabel source tracking', () => { }); it('pushes to initiate the remote', () => { - execCmd('force:source:push --json', { ensureExitCode: 0 }); + execCmd('force:source:push --json', { ensureExitCode: 0, cli: 'dev' }); }); it("deletes the 'DeleteMe' CustomLabel", async () => { @@ -62,7 +62,8 @@ describe('CustomLabel source tracking', () => { await conn.tooling.sobject('CustomLabel').delete(id); expect((await conn.tooling.query('SELECT Id FROM CustomLabel')).totalSize).to.equal(2); - const result = execCmd('force:source:pull -f --json', { ensureExitCode: 0 }).jsonOutput?.result; + const result = execCmd('force:source:pull -f --json', { ensureExitCode: 0, cli: 'dev' }).jsonOutput + ?.result; expect(result?.pulledSource.length).to.equal(1); expect(result?.pulledSource[0].state).to.equal('Deleted'); expect(result?.pulledSource[0].fullName).to.equal('DeleteMe'); @@ -93,7 +94,7 @@ describe('CustomLabel source tracking', () => { await conn.tooling.sobject('CustomLabel').delete(ids[1]); expect((await conn.tooling.query('SELECT Id FROM CustomLabel')).totalSize).to.equal(0); - const result = execCmd('force:source:pull', { ensureExitCode: 0 }).shellOutput.stdout; + const result = execCmd('force:source:pull', { ensureExitCode: 0, cli: 'dev' }).shellOutput.stdout; expect(fs.existsSync(clFile)).to.be.false; expect(result).to.contain('KeepMe1'); expect(result).to.contain('KeepMe2'); diff --git a/test/nuts/trackingCommands/deployRetrieveDelete.nut.ts b/test/nuts/trackingCommands/deployRetrieveDelete.nut.ts index 38a390bc5..a47f186c7 100644 --- a/test/nuts/trackingCommands/deployRetrieveDelete.nut.ts +++ b/test/nuts/trackingCommands/deployRetrieveDelete.nut.ts @@ -39,6 +39,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { it('detects the initial metadata status', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result).to.be.an.instanceof(Array); // the fields should be populated @@ -47,6 +48,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { it('deploy the initial metadata to the org with tracking', () => { const result = execCmd('force:source:deploy -p force-app,my-app,foo-bar/app -t --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.deployedSource).to.be.an.instanceof(Array); expect(result?.deployedSource, JSON.stringify(result)).to.have.length.greaterThan(10); @@ -58,11 +60,13 @@ describe('-t flag for deploy, retrieve, and delete', () => { it('sees no local changes (all were committed from deploy), but profile updated in remote', () => { const localResult = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(localResult).to.deep.equal([]); const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(remoteResult?.some((item) => item.type === 'Profile')).to.equal(true); }); @@ -71,6 +75,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { it('can retrieve the remote profile', () => { const retrieveResult = execCmd('force:source:retrieve -m Profile:Admin -t --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( retrieveResult?.inboundFiles.some((item) => item.type === 'Profile'), @@ -81,6 +86,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { it('sees no local or remote changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( result?.filter((r) => r.type === 'Profile'), @@ -93,12 +99,14 @@ describe('-t flag for deploy, retrieve, and delete', () => { it("won't confuse -o/-u", () => { execCmd(`force:source:deploy -p force-app,my-app,foo-bar/app -o --json`, { ensureExitCode: 0, + cli: 'dev', }); execCmd( `force:source:deploy -p force-app,my-app,foo-bar/app -o -u ${session.orgs.get('default')?.username} --json`, { ensureExitCode: 0, + cli: 'dev', } ); @@ -108,6 +116,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { } --json`, { ensureExitCode: 0, + cli: 'dev', } ); @@ -117,6 +126,7 @@ describe('-t flag for deploy, retrieve, and delete', () => { } --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); diff --git a/test/nuts/trackingCommands/forceIgnore.nut.ts b/test/nuts/trackingCommands/forceIgnore.nut.ts index 35a124057..b5552f44a 100644 --- a/test/nuts/trackingCommands/forceIgnore.nut.ts +++ b/test/nuts/trackingCommands/forceIgnore.nut.ts @@ -65,6 +65,7 @@ describe('forceignore changes', () => { // nothing should push const output = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; expect(output).to.deep.equal([]); }); @@ -72,6 +73,7 @@ describe('forceignore changes', () => { it('shows the file in status as ignored', () => { const output = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(output, JSON.stringify(output)).to.deep.include({ state: 'Local Add', @@ -99,6 +101,7 @@ describe('forceignore changes', () => { // pushes with no results const ignoredOutput = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; // nothing should have been pushed expect(ignoredOutput).to.deep.equal([]); @@ -111,6 +114,7 @@ describe('forceignore changes', () => { // verify file pushed in results const unIgnoredOutput = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; // all 4 files should have been pushed @@ -144,12 +148,14 @@ describe('forceignore changes', () => { // gets file into source tracking const statusOutput = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(statusOutput?.some((result) => result.fullName === 'CreatedClass')).to.equal(true); // pull doesn't retrieve that change const pullOutput = execCmd('force:source:pull --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(pullOutput?.pulledSource.some((result) => result.fullName === 'CreatedClass')).to.equal(false); }); diff --git a/test/nuts/trackingCommands/lwc.nut.ts b/test/nuts/trackingCommands/lwc.nut.ts index 7fc97b94f..86542e96d 100644 --- a/test/nuts/trackingCommands/lwc.nut.ts +++ b/test/nuts/trackingCommands/lwc.nut.ts @@ -55,6 +55,7 @@ describe('lwc', () => { ); const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.find((r) => r.filePath === cssPathRelative)).to.have.property('actualState', 'Changed'); }); @@ -62,6 +63,7 @@ describe('lwc', () => { it('pushes lwc css change', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; // we get a result for each bundle member, even though only one changed expect(result?.filter((r) => r.fullName === 'heroDetails')).to.have.length(4); @@ -70,6 +72,7 @@ describe('lwc', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }) .jsonOutput?.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); @@ -80,6 +83,7 @@ describe('lwc', () => { await fs.promises.rm(cssPathAbsolute); const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }) .jsonOutput?.result.filter(filterIgnored) .find((r) => r.filePath === cssPathRelative); @@ -98,6 +102,7 @@ describe('lwc', () => { it('pushes lwc subcomponent delete', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; const bundleMembers = result?.filter((r) => r.fullName === 'heroDetails'); expect(bundleMembers).to.have.length(4); @@ -108,6 +113,7 @@ describe('lwc', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }) .jsonOutput?.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); @@ -129,6 +135,7 @@ describe('lwc', () => { ); const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.filter((r) => r.origin === 'Local'); expect(result?.filter(filterIgnored)).to.have.length(4); expect(result?.filter(filterIgnored).filter((r) => r.actualState === 'Deleted')).to.have.length(3); @@ -138,6 +145,7 @@ describe('lwc', () => { it('push deletes the LWC remotely', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; // there'll also be changes for the changed Hero component html, but we've already tested changing a bundle member const bundleMembers = result?.filter((r) => r.fullName === 'heroDetails'); @@ -151,6 +159,7 @@ describe('lwc', () => { it('sees no local changes', () => { const result = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }) .jsonOutput?.result.filter((r) => r.origin === 'Local') .filter(filterIgnored); diff --git a/test/nuts/trackingCommands/mpd-non-sequential.nut.ts b/test/nuts/trackingCommands/mpd-non-sequential.nut.ts index 4f2ccdc3f..7592b6cd7 100644 --- a/test/nuts/trackingCommands/mpd-non-sequential.nut.ts +++ b/test/nuts/trackingCommands/mpd-non-sequential.nut.ts @@ -45,6 +45,7 @@ describe('multiple pkgDirectories pushed as one deploy', () => { it('pushes using MPD', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; expect(result).to.be.an.instanceof(Array); // the fields should be populated diff --git a/test/nuts/trackingCommands/mpd-sequential.nut.ts b/test/nuts/trackingCommands/mpd-sequential.nut.ts index 6b6a23d11..bc353575f 100644 --- a/test/nuts/trackingCommands/mpd-sequential.nut.ts +++ b/test/nuts/trackingCommands/mpd-sequential.nut.ts @@ -58,6 +58,7 @@ describe('multiple pkgDirs deployed sequentially', () => { it('pushes using MPD', () => { const result = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result.pushedSource; expect(result).to.be.an.instanceof(Array); // the fields should be populated diff --git a/test/nuts/trackingCommands/remoteChanges.nut.ts b/test/nuts/trackingCommands/remoteChanges.nut.ts index ab80a67f7..5e97cd876 100644 --- a/test/nuts/trackingCommands/remoteChanges.nut.ts +++ b/test/nuts/trackingCommands/remoteChanges.nut.ts @@ -87,6 +87,7 @@ describe('remote changes', () => { it('can see the delete in status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; // it shows up as one class on the server, but 2 files when pulled expect( @@ -97,11 +98,13 @@ describe('remote changes', () => { it('does not see any change in local status', () => { const result = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(result?.filter(filterIgnored)).to.deep.equal([]); }); it('can pull the delete', () => { - const result = execCmd('force:source:pull --json', { ensureExitCode: 0 }).jsonOutput?.result; + const result = execCmd('force:source:pull --json', { ensureExitCode: 0, cli: 'dev' }).jsonOutput + ?.result; // ebikes ignore file doesn't catch this somehow on windows (probably that slash) // https://github.com/trailheadapps/ebikes-lwc/blob/3e5baf83d97bc71660feaa9922f8fed2e686f5f8/.forceignore#L136-L137 const filteredSource = result?.pulledSource.filter((r) => !r.fullName.includes('prm_channel_reports_folder')); @@ -127,11 +130,13 @@ describe('remote changes', () => { it('sees correct local and remote status', () => { const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(remoteResult?.filter((r) => r.state.includes('Remote Deleted'))).to.deep.equal([]); const localStatus = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(localStatus?.filter(filterIgnored)).to.deep.equal([]); }); @@ -152,6 +157,7 @@ describe('remote changes', () => { it('can see the add in status', () => { const result = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( result?.some((r) => r.fullName === className), @@ -159,7 +165,8 @@ describe('remote changes', () => { ).to.equal(true); }); it('can pull the add', () => { - const result = execCmd('force:source:pull --json', { ensureExitCode: 0 }).jsonOutput?.result; + const result = execCmd('force:source:pull --json', { ensureExitCode: 0, cli: 'dev' }).jsonOutput + ?.result; // SDR marks all retrieves as 'Changed' even if it creates new local files. This is different from toolbelt, which marked those as 'Created' result?.pulledSource .filter((r) => r.fullName === className) @@ -168,6 +175,7 @@ describe('remote changes', () => { it('sees correct local and remote status', () => { const remoteResult = execCmd('force:source:status --json --remote', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect( remoteResult?.filter((r) => r.fullName === className), @@ -176,6 +184,7 @@ describe('remote changes', () => { const localStatus = execCmd('force:source:status --json --local', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(localStatus?.filter(filterIgnored)).to.deep.equal([]); }); diff --git a/test/nuts/translation.nut.ts b/test/nuts/translation.nut.ts index 581bff291..bf9513be9 100644 --- a/test/nuts/translation.nut.ts +++ b/test/nuts/translation.nut.ts @@ -42,6 +42,7 @@ describe('translations', () => { it('can deploy the whole project', () => { execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -51,6 +52,7 @@ describe('translations', () => { await fs.promises.writeFile(fieldFile, original.replace('spanish', 'espaƱol')); const statusResult = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(statusResult?.at(0)?.type).to.equal('CustomObjectTranslation'); @@ -59,6 +61,7 @@ describe('translations', () => { it('push local change', () => { const pushResult = execCmd('force:source:push --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(pushResult?.pushedSource.every((s) => s.type === 'CustomObjectTranslation')).to.be.true; }); @@ -66,6 +69,7 @@ describe('translations', () => { it('sees no local changes', () => { const statusResult = execCmd('force:source:status --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(statusResult).to.deep.equal([]); }); @@ -79,6 +83,7 @@ describe('translations', () => { it('can generate manifest for translation types', () => { execCmd('force:source:manifest:create -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); expect(fs.existsSync(path.join(session.project.dir, 'package.xml'))).to.be.true; }); @@ -86,6 +91,7 @@ describe('translations', () => { it('deploy', () => { const deployResults = execCmd('force:source:deploy -x package.xml --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(deployResults?.deployedSource.length).to.equal(7); }); @@ -96,6 +102,7 @@ describe('translations', () => { await fs.promises.mkdir(path.join(session.project.dir, 'force-app')); const retrieveResults = execCmd('force:source:retrieve -x package.xml --json', { ensureExitCode: 0, + cli: 'dev', }).jsonOutput?.result; expect(retrieveResults?.inboundFiles).to.have.length(7); }); @@ -106,6 +113,7 @@ describe('translations', () => { it('can deploy all metadata items', () => { execCmd('force:source:deploy -m CustomFieldTranslation,CustomObjectTranslation --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -114,6 +122,7 @@ describe('translations', () => { it('can retrieve all metadata items', () => { execCmd('force:source:retrieve -m CustomFieldTranslation,CustomObjectTranslation --json', { ensureExitCode: 0, + cli: 'dev', }); }); }); @@ -124,6 +133,7 @@ describe('translations', () => { it('can deploy the whole project', () => { execCmd('force:source:deploy -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -131,6 +141,7 @@ describe('translations', () => { it('can deploy COT', () => { execCmd(`force:source:deploy -p ${translationPath} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); @@ -139,6 +150,7 @@ describe('translations', () => { `force:source:deploy -p ${path.join(translationPath, 'customField__c.fieldTranslation-meta.xml')} --json`, { ensureExitCode: 0, + cli: 'dev', } ); expect(result.jsonOutput?.result.deployedSource.some((d) => d.type === 'CustomObjectTranslation')).to.be.true; @@ -149,6 +161,7 @@ describe('translations', () => { `force:source:deploy -p ${path.join(translationPath, 'customField__c.fieldTranslation-meta.xml')} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -159,6 +172,7 @@ describe('translations', () => { it('can retrieve the whole project', () => { execCmd('force:source:retrieve -p force-app --json', { ensureExitCode: 0, + cli: 'dev', }); }); @@ -166,6 +180,7 @@ describe('translations', () => { it('can retrieve COT', () => { execCmd(`force:source:retrieve -p ${translationPath} --json`, { ensureExitCode: 0, + cli: 'dev', }); }); @@ -177,6 +192,7 @@ describe('translations', () => { )} --json`, { ensureExitCode: 0, + cli: 'dev', } ); }); @@ -186,7 +202,7 @@ describe('translations', () => { describe('mdapi format', () => { it('can convert COT/CFTs correctly', () => { - execCmd('force:source:convert --outputdir mdapi', { ensureExitCode: 0 }); + execCmd('force:source:convert --outputdir mdapi', { ensureExitCode: 0, cli: 'dev' }); // the CFTs shouldn't be written to mdapi format expect(fs.existsSync(path.join(session.project.dir, 'mdapi', 'fields'))).to.be.false; expect(fs.existsSync(path.join(session.project.dir, 'mdapi', 'objectTranslations'))).to.be.true; diff --git a/yarn.lock b/yarn.lock index d10105f3a..54cb90521 100644 --- a/yarn.lock +++ b/yarn.lock @@ -987,10 +987,10 @@ strip-ansi "6.0.1" ts-retry-promise "^0.7.1" -"@salesforce/cli-plugins-testkit@^5.0.0-dev.2": - version "5.0.0-dev.2" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.0.0-dev.2.tgz#735ebc0e15bec2cced49ebaba937184cbe33d1ee" - integrity sha512-fHvSBBCouzDRHQYif3csXKQ9Yb0esNvl++8+DKCem+CPcqdVgzVGOzF4SAkU+8+ChgkPNAG4Jr4qqHYPEXmoVQ== +"@salesforce/cli-plugins-testkit@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.0.0.tgz#0ced85db4ca9f38ea0f486782c1e132fa43fe843" + integrity sha512-j0M7XC09ctpreFL6aPXkDIEZujlnNId4JMtTzfWA++Lpzj4PVj84zPBdXzGWSold/m9pf4EC7HZWaFS9kK/KVQ== dependencies: "@salesforce/core" "^5.3.10" "@salesforce/kit" "^3.0.15"