fix(core): link errors to ADEV (#55554)

Console error links will now point to adev.

PR Close #55554
This commit is contained in:
Matthieu Riegler 2024-04-26 01:10:52 +02:00 committed by Pawel Kozlowski
parent d57257514d
commit d73a0175cb
17 changed files with 30 additions and 30 deletions

View file

@ -118,7 +118,7 @@ describe('ngFor', () => {
getComponent().items = <any>'whaaa';
expect(() => fixture.detectChanges()).toThrowError(
`NG02200: Cannot find a differ supporting object 'whaaa' of type 'string'. NgFor only supports binding to Iterables, such as Arrays. Find more at https://angular.io/errors/NG02200`,
`NG02200: Cannot find a differ supporting object 'whaaa' of type 'string'. NgFor only supports binding to Iterables, such as Arrays. Find more at https://angular.dev/errors/NG02200`,
);
}));
@ -127,7 +127,7 @@ describe('ngFor', () => {
getComponent().items = <any>{'stuff': 'whaaa'};
expect(() => fixture.detectChanges()).toThrowError(
`NG02200: Cannot find a differ supporting object '\[object Object\]' of type 'object'. NgFor only supports binding to Iterables, such as Arrays. Did you mean to use the keyvalue pipe? Find more at https://angular.io/errors/NG02200`,
`NG02200: Cannot find a differ supporting object '\[object Object\]' of type 'object'. NgFor only supports binding to Iterables, such as Arrays. Did you mean to use the keyvalue pipe? Find more at https://angular.dev/errors/NG02200`,
);
}));

View file

@ -64,7 +64,7 @@ describe('NgModule', () => {
expect(() => createInjector(AModule)).toThrowError(
'NG0200: Circular dependency in DI detected for AModule. ' +
'Dependency path: AModule > BModule > AModule. ' +
'Find more at https://angular.io/errors/NG0200',
'Find more at https://angular.dev/errors/NG0200',
);
});

View file

@ -10,7 +10,7 @@ import {ErrorCode} from './error_code';
/**
* Contains a set of error messages that have detailed guides at angular.io.
* Full list of available error guides can be found at https://angular.io/errors
* Full list of available error guides can be found at https://angular.dev/errors
*/
export const COMPILER_ERRORS_WITH_GUIDES = new Set([
ErrorCode.DECORATOR_ARG_NOT_LITERAL,

View file

@ -13,4 +13,4 @@
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';

View file

@ -13,7 +13,7 @@
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';
/**
* URL for the XSS security documentation.

View file

@ -16,7 +16,7 @@ import {ERROR_DETAILS_PAGE_BASE_URL} from './error_details_base_url';
* angular.io. This extra annotation is needed to avoid introducing a separate set to store
* error codes which have guides, which might leak into runtime code.
*
* Full list of available error guides can be found at https://angular.io/errors.
* Full list of available error guides can be found at https://angular.dev/errors.
*
* Error code ranges per package:
* - core (this package): 100-999

View file

@ -177,7 +177,7 @@ function logLazyLCPWarning(src: string) {
`changing the loading value of the LCP image to "eager", or by using the ` +
`NgOptimizedImage directive's prioritization utilities. For more ` +
`information about addressing or disabling this warning, see ` +
`https://angular.io/errors/NG0913`,
`https://angular.dev/errors/NG0913`,
),
);
}
@ -189,7 +189,7 @@ function logOversizedImageWarning(src: string) {
`An image with src ${src} has intrinsic file dimensions much larger than its ` +
`rendered size. This can negatively impact application loading performance. ` +
`For more information about addressing or disabling this warning, see ` +
`https://angular.io/errors/NG0913`,
`https://angular.dev/errors/NG0913`,
),
);
}

View file

@ -30,7 +30,7 @@ describe('di with forwardRef', () => {
TestBed.configureTestingModule({declarations: [DirectiveA, DirectiveB, MyComp]});
expect(() => TestBed.createComponent(MyComp)).toThrowError(
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.io/errors/NG0200',
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.dev/errors/NG0200',
);
});

View file

@ -1103,7 +1103,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveA, DirectiveB, MyComp]});
expect(() => TestBed.createComponent(MyComp)).toThrowError(
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.io/errors/NG0200',
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.dev/errors/NG0200',
);
});
@ -2216,7 +2216,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveString, MyComp, MyApp]});
expect(() => TestBed.createComponent(MyApp)).toThrowError(
'NG0201: No provider for String found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for String found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
});
@ -2289,7 +2289,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveComp, MyComp, MyApp]});
expect(() => TestBed.createComponent(MyApp)).toThrowError(
'NG0201: No provider for MyApp found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for MyApp found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
});

View file

@ -183,7 +183,7 @@ describe('ApplicationInitStatus', () => {
'NG0209: Unexpected type of the `APP_INITIALIZER` token value ' +
`(expected an array, but got string). ` +
'Please check that the `APP_INITIALIZER` token is configured as a ' +
'`multi: true` provider. Find more at https://angular.io/errors/NG0209',
'`multi: true` provider. Find more at https://angular.dev/errors/NG0209',
);
});
});

View file

@ -532,7 +532,7 @@ describe('bootstrap', () => {
`NG0403: The module MyModule was bootstrapped, ` +
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
`Please define one of these. ` +
`Find more at https://angular.io/errors/NG0403`;
`Find more at https://angular.dev/errors/NG0403`;
expect(e.message).toEqual(expectedErrMsg);
expect(mockConsole.res[0].join('#')).toEqual('ERROR#Error: ' + expectedErrMsg);
},

View file

@ -666,7 +666,7 @@ describe('View injector', () => {
it('should not instantiate a directive with cyclic dependencies', () => {
TestBed.configureTestingModule({declarations: [CycleDirective]});
expect(() => createComponent('<div cycleDirective></div>')).toThrowError(
'NG0200: Circular dependency in DI detected for CycleDirective. Find more at https://angular.io/errors/NG0200',
'NG0200: Circular dependency in DI detected for CycleDirective. Find more at https://angular.dev/errors/NG0200',
);
});
@ -683,7 +683,7 @@ describe('View injector', () => {
});
expect(() => createComponent('<div simpleComponent></div>')).toThrowError(
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
},
);
@ -705,7 +705,7 @@ describe('View injector', () => {
expect(() =>
createComponent('<div simpleComponent someOtherDirective></div>'),
).toThrowError(
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
},
);
@ -715,7 +715,7 @@ describe('View injector', () => {
expect(() =>
createComponent('<div simpleDirective><div needsDirectiveFromSelf></div></div>'),
).toThrowError(
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
});
@ -761,7 +761,7 @@ describe('View injector', () => {
set: {template: '<div needsDirectiveFromHost></div>'},
});
expect(() => createComponent('<div simpleComponent simpleDirective></div>')).toThrowError(
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
});

View file

@ -50,7 +50,7 @@ describe('di', () => {
expect(() => {
TestBed.createComponent(App).detectChanges();
}).toThrowError(
'NG0201: No provider for DirNotOnSelf found in NodeInjector. Find more at https://angular.io/errors/NG0201',
'NG0201: No provider for DirNotOnSelf found in NodeInjector. Find more at https://angular.dev/errors/NG0201',
);
});
});

View file

@ -11,7 +11,7 @@ import {RuntimeError, RuntimeErrorCode} from '../src/errors';
describe('RuntimeError utils', () => {
it('should correctly format an error without an error message', () => {
const error = new RuntimeError<RuntimeErrorCode>(RuntimeErrorCode.EXPORT_NOT_FOUND, '');
expect(error.toString()).toBe('Error: NG0301. Find more at https://angular.io/errors/NG0301');
expect(error.toString()).toBe('Error: NG0301. Find more at https://angular.dev/errors/NG0301');
});
it('should correctly format an error without an error message not aio guide', () => {
@ -27,7 +27,7 @@ describe('RuntimeError utils', () => {
it('should correctly format an error with both an error message and an aio guide', () => {
const error = new RuntimeError(RuntimeErrorCode.EXPORT_NOT_FOUND, 'Some error message');
expect(error.toString()).toBe(
'Error: NG0301: Some error message. Find more at https://angular.io/errors/NG0301',
'Error: NG0301: Some error message. Find more at https://angular.dev/errors/NG0301',
);
});
@ -39,7 +39,7 @@ describe('RuntimeError utils', () => {
errorMessage,
);
expect(error.toString()).toBe(
`Error: NG0302: Pipe not found${character} Find more at https://angular.io/errors/NG0302`,
`Error: NG0302: Pipe not found${character} Find more at https://angular.dev/errors/NG0302`,
);
}),
);

View file

@ -212,7 +212,7 @@ describe('Form Directives', () => {
expect(() => form.addControl(dir)).toThrowError(
new RegExp(
`NG01203: No value accessor for form control name: 'login'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'login'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
@ -225,7 +225,7 @@ describe('Form Directives', () => {
expect(() => form.addControl(dir)).toThrowError(
new RegExp(
`NG01203: No value accessor for form control path: 'passwords -> password'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control path: 'passwords -> password'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
@ -620,7 +620,7 @@ describe('Form Directives', () => {
expect(() => namedDir.ngOnChanges({})).toThrowError(
new RegExp(
`NG01203: No value accessor for form control name: 'one'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'one'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
@ -630,7 +630,7 @@ describe('Form Directives', () => {
expect(() => unnamedDir.ngOnChanges({})).toThrowError(
new RegExp(
`NG01203: No value accessor for form control unspecified name attribute. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control unspecified name attribute. Find more at https://angular.dev/errors/NG01203`,
),
);
});

View file

@ -1523,7 +1523,7 @@ import {asyncValidator, asyncValidatorReturningObservable} from './util';
expect(fn).toThrowError(
'NG01101: Expected async validator to return Promise or Observable. ' +
'Are you using a synchronous validator where an async validator is expected? ' +
'Find more at https://angular.io/errors/NG01101',
'Find more at https://angular.dev/errors/NG01101',
);
});

View file

@ -5803,7 +5803,7 @@ describe('reactive forms integration tests', () => {
expect(() => {
fixture.detectChanges();
}).toThrowError(
`NG01203: No value accessor for form control name: 'control'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'control'. Find more at https://angular.dev/errors/NG01203`,
);
// Making sure that cleanup between tests doesn't cause any issues