所以我正在用karma / jasmine做一个简单的单元测试。我正在使用webpack 2。
//Running it.
"test": "karma start --singleRun true --browsers Chrome",
//packages
"jasmine-core": "^2.4.1",
"karma": "^1.1.1",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.1.0",
"karma-htmlfile-reporter": "^0.3.4",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-nyan-reporter": "^0.2.4",
"karma-phantomjs-launcher": "^1.0.2",
"karma-remap-coverage": "^0.1.2",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-sourcemap-writer": "^0.1.2",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "^1.8.0",
因此,当我运行测试时,Chrome会启动,但会显示灰屏。
测试是一个简单的测试
import { NgRedux } from 'ng2-redux';
import { BlogPostActions } from './blog-post.actions';
class MockRedux extends NgRedux<any> {
constructor() {
super(undefined);
}
public dispatch = () => undefined;
};
describe('Login Actions Creators', () => {
let actions: BlogPostActions;
let mockRedux: NgRedux<any>;
beforeEach(() => {
mockRedux = new MockRedux();
actions = new BlogPostActions(mockRedux);
});
it('should dispatch validate action', () => {
expect(true).toBe(true);
});
});
任何人都有任何想法可能会导致这个?这让我抓狂!如果您需要更多信息,请告诉我们!命令行中没有错误。
答案 0 :(得分:0)
当终端(无论是代码终端还是git bash)作为管理员运行时,我正在使用的版本无效。删除它,修复了问题。