在 Karma 中更新 Angular2 后,Http 测试(MockBackend、MockConnection)出现问题

Issues with Http testing (MockBackend, MockConnection) after Angular2 update in Karma

将 Angular2 更新到最新版本 (alpha 53) 后,我在 Karma 中导入与测试 Http 服务相关的文件时遇到了问题。我在业力中有这样的参考:

files: [
    {pattern: 'node_modules/systemjs/dist/system.js', included: true, watched: true},
    {pattern: 'node_modules/angular2/bundles/angular2.js', included: true, watched: true},
    {pattern: 'node_modules/angular2/bundles/testing.js', included: true, watched: true},
    {pattern: 'node_modules/  angular2/bundles/http.js', included: true, watched: true},
    {pattern: 'karma-test-shim.js', included: true, watched: true}]

我知道 MockBackend、MockConnection 从 angular2/http 移动到 angular2/http/testing,我的问题是我不知道如何导入这些移动的 类,因为我没有在 bundles 文件夹(或整个 angular2 目录)中找不到任何类似于 http-testing.js 或类似内容的东西,而且我无法在存在的任何 bundle 文件中找到它。

有什么办法可以解决这个问题吗?

从 beta 0 开始,MockBackend/Connection 是 testing.dev.js 捆绑包的一部分。