Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove error name assertions (let SDR handle) #1251

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions test/nuts/seeds/deploy.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ context('Deploy metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const deploy = await testkit.deploy({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
testkit.expect.errorToHaveName(deploy ?? {}, 'SfError');
await testkit.deploy({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
});

it('should not deploy metadata outside of a package directory', async () => {
Expand Down
4 changes: 1 addition & 3 deletions test/nuts/seeds/retrieve.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { SourceTestkit } from '@salesforce/source-testkit';
import { JsonMap } from '@salesforce/ts-types';
import { RepoConfig, TEST_REPOS_MAP } from '../testMatrix.js';

// DO NOT TOUCH. generateNuts.ts will insert these values
Expand Down Expand Up @@ -70,8 +69,7 @@ context('Retrieve metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const retrieve = (await testkit.retrieve({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 })) as JsonMap;
testkit.expect.errorToHaveName(retrieve, 'SfError');
await testkit.retrieve({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
});
});
});
6 changes: 2 additions & 4 deletions test/nuts/seeds/retrieve.retrievetargetdir.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import { fileURLToPath } from 'node:url';
import { SourceTestkit } from '@salesforce/source-testkit';
import { JsonMap } from '@salesforce/ts-types';
import { RepoConfig, TEST_REPOS_MAP } from '../testMatrix.js';

// DO NOT TOUCH. generateNuts.ts will insert these values
Expand Down Expand Up @@ -45,11 +44,10 @@ context('Retrieve metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const retrieve = (await testkit.retrieve({
await testkit.retrieve({
args: '--retrievetargetdir targetdir --metadata DOES_NOT_EXIST',
exitCode: 1,
})) as JsonMap;
testkit.expect.errorToHaveName(retrieve, 'SfError');
});
});
});
});