typescript 使用参数,数据和快照模拟ActivatedRoute。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 使用参数,数据和快照模拟ActivatedRoute。相关的知识,希望对你有一定的参考价值。
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MdToolbarModule,
],
providers: [
{
provide: Router,
useClass: MockRouter,
},
{
provide: ActivatedRoute,
useValue: {
data: {
subscribe: (fn: (value: Data) => void) => fn({
company: COMPANY,
}),
},
params: {
subscribe: (fn: (value: Params) => void) => fn({
tab: 0,
}),
},
snapshot: {
url: [
{
path: 'foo',
},
{
path: 'bar',
},
{
path: 'baz',
},
],
},
},
},
],
})
.overrideComponent(ConversationsComponent, {
set: {
template: '',
}
});
}));
以上是关于typescript 使用参数,数据和快照模拟ActivatedRoute。的主要内容,如果未能解决你的问题,请参考以下文章
你如何保存android模拟器快照?
使用 Jest 手动模拟 React-Intl 进行快照测试
oracle 11g rac ORA-01555 快照过旧报错处理
我可以在颤振中的 **noSuchMethod()** 方法中使用啥参数来处理空快照数据?
Android 模拟器快照错误
Swift 3 / 为啥快照视图中的快照在 iPhone 7 Plus 模拟器中显示为空白?