fix(ivy): TestBed should tolerate synchronous use of compileComponents
(#28350)
TestBed.compileComponents has always been an async API. However, ViewEngine tolerated using this API in a synchronous manner if the components declared in the testing module did not have any async resources (templateUrl, styleUrls). This change makes the ivy TestBed mirror this tolerance by configuring such components synchronously. Ref: FW-992 PR Close #28350
This commit is contained in:

committed by
Jason Aden

parent
f8c70011b1
commit
3deda898d0
@ -91,8 +91,8 @@ export function maybeQueueResolutionOfComponentResources(metadata: Component) {
|
||||
}
|
||||
}
|
||||
|
||||
export function componentNeedsResolution(component: Component) {
|
||||
return component.templateUrl || component.styleUrls && component.styleUrls.length;
|
||||
export function componentNeedsResolution(component: Component): boolean {
|
||||
return !!(component.templateUrl || component.styleUrls && component.styleUrls.length);
|
||||
}
|
||||
export function clearResolutionOfComponentResourcesQueue() {
|
||||
componentResourceResolutionQueue.clear();
|
||||
@ -100,4 +100,4 @@ export function clearResolutionOfComponentResourcesQueue() {
|
||||
|
||||
function unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {
|
||||
return typeof response == 'string' ? response : response.text();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user