WebStorm DartUnit with test api, run/debug error

最后都变了- 提交于 2019-12-02 12:24:23

问题


I'm using WebStorm IDE and test api which is named unittest before. The test works fine using the command:

pub run test:test test/sample.dart

/test/sample.dart

library testproject.sample;

import 'package:test/test.dart';

void main() {
  test('Testing', () {
    expect(true, isTrue);
  });
}

but when i tried to run/debug using WebStorm DartUnit the test, the console shows this error:

Unhandled exception:
Uncaught Error: Load Error: FileSystemException: Cannot open file, path = 'C:\Users\dummy\Desktop\testproject\packages\unittest\unittest.dart' (OS Error: The system cannot find the path specified.
, errno = 3) 

回答1:


WebStorm is still hardwired to the old unittest package. There is an open issue to fix this https://youtrack.jetbrains.com/issue/WEB-16053

You can however execute Dart test scripts using the new test package like any other Dart script, to be able to use the debugger. If you use custom HTML pages for your tests, you need to replace the x-dart-test link to a proper Dart script tag to be able to execute it from WebStorm.



来源:https://stackoverflow.com/questions/30763583/webstorm-dartunit-with-test-api-run-debug-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!