Skip to content

Commit

Permalink
test: debug all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 14, 2023
1 parent b8dcecb commit e071ccd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/nuts/seeds/deploy.metadata.metadata-dir.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/* eslint-disable no-console */

import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
Expand All @@ -25,6 +26,7 @@ context('deploy metadata --metadata-dir NUTs [name: %REPO_NAME%]', () => {
repository: REPO.gitUrl,
nut: fileURLToPath(import.meta.url),
});
console.log('before is done. project/repo created');
});

after(async () => {
Expand All @@ -43,16 +45,23 @@ context('deploy metadata --metadata-dir NUTs [name: %REPO_NAME%]', () => {
const paths = testCase.toDeploy.map((t) => path.normalize(t)).join(',');
// This is using the force:source:convert command from plugin-source. Once we have an
// sf equivalent, we should switch it to use that.
console.log('converting first paths: ', paths);

await testkit.convert({ args: `--sourcepath ${paths} --outputdir out` });
console.log('converting done: ', paths);
console.log('deploying using mdapi');

const deploy = await testkit.deploy<DeployResultJson>({ args: '--metadata-dir out' });
console.log('deploying complete');
assert(deploy);
testkit.expect.toHavePropertyAndValue(deploy.result as unknown as JsonMap, 'status', RequestStatus.Succeeded);
});
}

console.log('done with deploys that should succeed');
it('should throw an error if the directory does not exist', async () => {
console.log('deploying a bad one');
const deploy = await testkit.deploy({ args: '--metadata-dir DOES_NOT_EXIST', exitCode: 1 });
console.log('deploying done');
assert(deploy);
testkit.expect.errorToHaveName(deploy, 'InvalidFlagPathError');
});
Expand Down

0 comments on commit e071ccd

Please sign in to comment.