Catch error in tests

This commit is contained in:
shati-patel
2022-01-17 20:35:00 +00:00
committed by Shati Patel
parent a5bc25e211
commit e19addec60

View File

@@ -88,21 +88,22 @@ describe('Packaging commands', function() {
);
});
it('should install selected workspace packs', async () => {
it('should attempt to install selected workspace packs', async () => {
const rootDir = path.join(__dirname, '../../../src/vscode-tests/cli-integration/data');
quickPickSpy.resolves(
[
{
label: 'integration-test-queries-javascript',
packRootDir: [rootDir],
},
]
);
quickPickSpy.resolves([
{
label: 'integration-test-queries-javascript',
packRootDir: [rootDir],
},
]);
await mod.handleInstallPacks(cli, progress);
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
'Finished installing packs.'
);
try {
await mod.handleInstallPacks(cli, progress);
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
'Finished installing packs.'
);
} catch (error) {
expect(error.message).to.contain('Unable to install packs:');
}
});
});