dart - Can not run unit test: No constructor 'Future.value' declared in class 'Future' -


i have new dart project fail add unit tests.

but new dart perhaps punished rookies should ... or should they!?

error when running unit tests

error: exception: no constructor 'future.value' declared in class 'future'.  nosuchmethoderror : method not found: 'future.value' receiver: type: class 'future' arguments: [] stack trace: #0      _defer (http://127.0.0.1:3030/users/gunnar/git/chessbuddy/src/main/webapp/dart/chessmodel/test/packages/unittest/unittest.dart:671:20) #1      _ensureinitialized (http://127.0.0.1:3030/users/gunnar/git/chessbuddy/src/main/webapp/dart/chessmodel/test/packages/unittest/unittest.dart:830:11) #2      ensureinitialized (http://127.0.0.1:3030/users/gunnar/git/chessbuddy/src/main/webapp/dart/chessmodel/test/packages/unittest/unittest.dart:809:21) #3      group (http://127.0.0.1:3030/users/gunnar/git/chessbuddy/src/main/webapp/dart/chessmodel/test/packages/unittest/unittest.dart:585:20) #4      main (http://127.0.0.1:3030/users/gunnar/git/chessbuddy/src/main/webapp/dart/chessmodel/test/test_runner.dart:9:8) fail 

pub info

€ pub --version pub 0.4.7+1.r21548 € pub cache list {"packages":     {"browser":{"version":"0.4.7+1","location":"/users/gunnar/.pub-cache/hosted/pub.dartlang.org/browser-0.4.7+1"},      "meta":{"version":"0.4.7+1","location":"/users/gunnar/.pub-cache/hosted/pub.dartlang.org/meta-0.4.7+1"},      "stagexl":{"version":"0.7.4","location":"/users/gunnar/.pub-cache/hosted/pub.dartlang.org/stagexl-0.7.4"},      "unittest":{"version":"0.4.7+1","location":"/users/gunnar/.pub-cache/hosted/pub.dartlang.org/unittest-0.4.7+1"}}} 

eclipse plugin

dart editor eclipse 0.4.7.r21548    com.google.dart.eclipse.feature.feature.group   dartlang.org 

test_runner.dart

import 'package:unittest/unittest.dart'; import 'package:unittest/html_enhanced_config.dart';  import 'chesscolor_test.dart' color_test;  void main() {   usehtmlenhancedconfiguration();    group('enum tests', color_test.main); } 

chesscolor_test.dart

library color_test;  import 'package:unittest/unittest.dart';  void main() {   test('iswhite', () =>     expect(true, white.iswhite())   ); } 

a couple of things try:

  • take @ dart-sdk/lib/async/future.dart. see future.value factory constructor? if not, sdk not right version. check both command line , within editor.

  • if see in sdk, try exiting , restarting editor. i'm speculating here, when saw once in house, behaved though there cached copy of async library out of date, , restarting made issue go way.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -