【发布时间】:2023-04-04 10:07:01
【问题描述】:
当我尝试在测试中将Injector 传递给beforeEachProviders 时,出现以下错误。
Failed: Cannot resolve all parameters for 'Injector'(?, ?, ?, ?, ?).
Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'Injector' is decorated with Injectable.
我使用的代码
import { Injector } from 'angular2/core';
describe(() => {
beforeEachProviders(() => [Injector]);
});
缺少什么?我应该给提供者什么才能实例化它?
【问题讨论】:
-
如果不看你的代码是什么样子就很难判断。
标签: testing angular angular2-testing