我正在尝试在WebStorm中运行吉尼斯世界纪录测试,但它因果报应不能识别吉尼斯测试。
下面使用unittest.dart可以工作(给我一个通过和失败的机会)
void main(){
test('trivial', () {
expect(1, equals(1));
});
test('trivial fail', () {
expect(1, equals(2));
});
}当我在同一文件中切换到使用guinness时:
void main(){
describe('stuff happens', (){
it('works sometimes', (){
expect(1).toEqual(1);
});
it('fails others', (){
expect(1).toEqual(2);
});
});
}Karma返回不测试的结果。
这是我的karma.config.js
module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['dart-unittest'],
files: [
'test/*.dart',
{pattern: '**/*.dart', watched: true, included: false, served: true},
'packages/browser/dart.js',
'packages/browser/interop.js'
],
exclude: [
],
autoWatch: true,
captureTimeout: 20000,
browserNoActivityTimeout: 300000,
plugins: [
'karma-dart'
],
karmaDartImports: {
guinness: 'package:guinness/guinness_html.dart'
},
browsers: ['Dartium']
});
};有没有人对可能出了什么问题有什么建议?
谢谢约翰
发布于 2016-01-26 17:09:34
在dart测试文件中执行以下import语句为我解决了这个问题:
import 'package:unittest/unittest.dart' hide expect;发布于 2015-12-14 06:25:13
查看链接的教程。也许你只是在你的karma配置文件的插件中缺少'karma-chrome-launcher‘。
Karma Dart Step by Step Setup
https://stackoverflow.com/questions/24141380
复制相似问题