-
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/build-angular): print server builder errors and w…
…arnings Previously server builder errors and warnings were not being printed in the console correctly. Closes #24612 (cherry picked from commit f35e990)
- Loading branch information
1 parent
b27ce5d
commit 317452e
Showing
3 changed files
with
52 additions
and
5 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
34 changes: 34 additions & 0 deletions
34
...ages/angular_devkit/build_angular/src/builders/server/tests/behavior/build-errors_spec.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import { logging } from '@angular-devkit/core'; | ||
import { execute } from '../../index'; | ||
import { BASE_OPTIONS, SERVER_BUILDER_INFO, describeBuilder } from '../setup'; | ||
|
||
describeBuilder(execute, SERVER_BUILDER_INFO, (harness) => { | ||
describe('Behavior: "Build Error"', () => { | ||
it('emits errors', async () => { | ||
harness.useTarget('server', { | ||
...BASE_OPTIONS, | ||
watch: true, | ||
}); | ||
|
||
// Generate an error | ||
await harness.appendToFile('src/main.server.ts', `const foo: = 'abc';`); | ||
|
||
const { result, logs } = await harness.executeOnce(); | ||
|
||
expect(result?.success).toBeFalse(); | ||
expect(logs).toContain( | ||
jasmine.objectContaining<logging.LogEntry>({ | ||
message: jasmine.stringMatching(/TS1110:.*Type expected/), | ||
}), | ||
); | ||
}); | ||
}); | ||
}); |
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