-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular-devkit/architect): improve error message when configurat…
…ion is missing This commit makes the error message more actionable. Closes #29742 (cherry picked from commit 6f0e90e)
- Loading branch information
1 parent
c073309
commit 3ebd7ca
Showing
2 changed files
with
10 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 7 additions & 13 deletions
20
tests/legacy-cli/e2e/tests/commands/unknown-configuration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
import assert from 'node:assert'; | ||
import { ng } from '../../utils/process'; | ||
import { expectToFail } from '../../utils/utils'; | ||
|
||
export default async function () { | ||
try { | ||
await ng('build', '--configuration', 'invalid'); | ||
throw new Error('should have failed.'); | ||
} catch (error) { | ||
if ( | ||
!( | ||
error instanceof Error && | ||
error.message.includes(`Configuration 'invalid' is not set in the workspace`) | ||
) | ||
) { | ||
throw error; | ||
} | ||
} | ||
const error = await expectToFail(() => ng('build', '--configuration', 'invalid')); | ||
assert.match( | ||
error.message, | ||
/Configuration 'invalid' for target 'build' in project 'test-project' is not set in the workspace/, | ||
); | ||
} |