MCPcopy Create free account
hub / github.com/angular/angular / verifyThrownError

Function verifyThrownError

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts:2845–2852  ·  view source on GitHub ↗
(errorCode: ErrorCode, errorMessage: string)

Source from the content-addressed store, hash-verified

2843
2844 describe('error handling', () => {
2845 function verifyThrownError(errorCode: ErrorCode, errorMessage: string) {
2846 const errors = env.driveDiagnostics();
2847 expect(errors.length).toBe(1);
2848 const {code, messageText} = errors[0];
2849 expect(code).toBe(ngErrorCode(errorCode));
2850 const text = ts.flattenDiagnosticMessageText(messageText, '\n');
2851 expect(trim(text)).toContain(errorMessage);
2852 }
2853
2854 it('should throw if invalid arguments are provided in @NgModule', () => {
2855 env.tsconfig({});

Callers 1

ngtsc_spec.tsFile · 0.85

Calls 5

ngErrorCodeFunction · 0.90
driveDiagnosticsMethod · 0.80
mapMethod · 0.80
trimFunction · 0.70
joinMethod · 0.65

Tested by

no test coverage detected