Skip to content

Commit

Permalink
test: more cli in nuts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 7, 2023
1 parent fb1543b commit 313919c
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/nuts/REST/deploy.mpd.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ context(`MPD REST Deploy NUTs [name: ${repo.name}]`, () => {
for (const manifest of repo.deploy.manifest) {
const toDeploy = path.normalize(manifest.toDeploy);
it(`should deploy ${toDeploy}`, async () => {
await testkit.convert({ args: `--sourcepath ${toDeploy} --outputdir out` });
await testkit.convert({ args: `--sourcepath ${toDeploy} --outputdir out`, cli: 'sf' });
const packageXml = path.join('out', 'package.xml');

const res = await testkit.deploy({ args: `--manifest ${packageXml}` });
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/REST/deploy.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ context(`REST Deploy NUTs [name: ${repo.name}]`, () => {
for (const testCase of repo.deploy.manifest) {
const toDeploy = path.normalize(testCase.toDeploy);
it(`should deploy ${toDeploy}`, async () => {
await testkit.convert({ args: `--sourcepath ${toDeploy} --outputdir out` });
await testkit.convert({ args: `--sourcepath ${toDeploy} --outputdir out`, cli: 'sf' });
const packageXml = path.join('out', 'package.xml');

const res = await testkit.deploy({ args: `--manifest ${packageXml}` });
Expand Down
1 change: 1 addition & 0 deletions test/nuts/digitalExperienceBundle/deb.metadata.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ describe('deb -- metadata option', () => {
`force:source:delete --metadata ${METADATA.DE_DOCUMENT_DETAIL_PAGE_A} --noprompt --json`,
{
ensureExitCode: 0,
cli: 'sf',
}
).jsonOutput.result.deletedSource;

Expand Down
1 change: 1 addition & 0 deletions test/nuts/digitalExperienceBundle/deb.sourcepath.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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: 'sf',
}
).jsonOutput.result.deletedSource;

Expand Down
1 change: 1 addition & 0 deletions test/nuts/digitalExperienceBundle/deb.tracking.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe('deb -- tracking/push/pull', () => {
it('should pull all debs after clearing source tracking info', () => {
execCmd<DeleteTrackingResult>('force:source:tracking:clear --noprompt', {
ensureExitCode: 0,
cli: 'sf',
});

const pulledSource = execCmd<PullResponse>('force:source:pull --forceoverwrite --json', {
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/seeds/deploy.manifest.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ context('Deploy manifest NUTs [name: %REPO_NAME%]', () => {
for (const testCase of REPO.deploy.manifest) {
const toDeploy = path.normalize(testCase.toDeploy);
it(`should deploy ${toDeploy}`, async () => {
await testkit.convert({ args: `--sourcepath ${testCase.toDeploy} --outputdir out` });
await testkit.convert({ args: `--sourcepath ${testCase.toDeploy} --outputdir out`, cli: 'sf' });
const packageXml = path.join('out', 'package.xml');

const res = await testkit.deploy({ args: `--manifest ${packageXml}` });
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/seeds/deploy.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ context('Deploy metadata NUTs [name: %REPO_NAME%]', () => {
});

it('should not deploy metadata outside of a package directory', async () => {
await testkit.createApexClass({ args: '--outputdir NotAPackage --classname ShouldNotBeDeployed' });
await testkit.createApexClass({ args: '--outputdir NotAPackage --classname ShouldNotBeDeployed', cli: 'sf' });
await testkit.deploy({ args: '--metadata ApexClass' });
// this is a glob, so no need for path.join
await testkit.expect.filesToNotBeDeployed(['NotAPackage/**/*']);
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/seeds/retrieve.manifest.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ context('Retrieve manifest NUTs [name: %REPO_NAME%]', () => {
const convertDir = `convert_${i++}`;
it(`should retrieve ${toRetrieve}`, async () => {
// generate package.xml to use with the --manifest param
await testkit.convert({ args: `--sourcepath ${testCase.toRetrieve} --outputdir ${convertDir}` });
await testkit.convert({ args: `--sourcepath ${testCase.toRetrieve} --outputdir ${convertDir}`, cli: 'sf' });
const packageXml = path.join(convertDir, 'package.xml');

await testkit.modifyLocalGlobs(testCase.toVerify);
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/translation.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,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: 'sf' });
// 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;
Expand Down

0 comments on commit 313919c

Please sign in to comment.