@angular/core/testinglink
入口点
主要
@angular/core |
次要
@angular/core/testing |
导出列表
类
ComponentFixture | Fixture for debugging and testing a component. |
TestComponentRenderer | An abstract class for inserting the root test component element in a platform independent way. |
TestBed | Configures and initializes environment for unit testing and provides methods for creating components and services in unit tests. |
InjectSetupWrapper |
函数
async | Wraps a test function in an asynchronous test zone. The test will automatically complete when all asynchronous calls within this zone are done. Can be used to wrap an 把一个测试函数包装进一个异步测试区域(Zone)。当该区域中的所有异步调用都已完成时,该测试将会自动完成。 可用于包装 |
resetFakeAsyncZone | Clears out the shared fake async zone for a test. To be called in a global |
fakeAsync | Wraps a function to be executed in the fakeAsync zone:
|
tick | Simulates the asynchronous passage of time for the timers in the fakeAsync zone. |
flush | Simulates the asynchronous passage of time for the timers in the fakeAsync zone by draining the macrotask queue until it is empty. The returned value is the milliseconds of time that would have been elapsed. |
discardPeriodicTasks | Discard all remaining periodic tasks. |
flushMicrotasks | Flush any pending microtasks. |
getTestBed | |
inject | Allows injecting dependencies in |
withModule | |
withBody | |
ensureDocument | Ensure that global has |
cleanupDocument | Restore the state of |
类型
ComponentFixtureAutoDetect | |
ComponentFixtureNoNgZone | |
TestModuleMetadata | |
MetadataOverride |