Index: pkg/template_binding/test/template_binding_test.dart |
diff --git a/pkg/template_binding/test/template_binding_test.dart b/pkg/template_binding/test/template_binding_test.dart |
index 42fd3897d65ebf36c285c739cf5f600c08624714..5501035f92ea05c12f9625223ef2d9976584e89d 100644 |
--- a/pkg/template_binding/test/template_binding_test.dart |
+++ b/pkg/template_binding/test/template_binding_test.dart |
@@ -168,7 +168,7 @@ templateInstantiationTests() { |
runZoned(() { |
templateBind(template).model = m; |
}, onError: (e, s) { |
- expect(e, isNoSuchMethodError); |
+ _expectNoSuchMethod(e); |
errorSeen = true; |
}); |
return new Future(() { |
@@ -252,7 +252,7 @@ templateInstantiationTests() { |
runZoned(() { |
templateBind(template).model = m; |
}, onError: (e, s) { |
- expect(e, isNoSuchMethodError); |
+ _expectNoSuchMethod(e); |
errorSeen = true; |
}); |
@@ -2376,7 +2376,7 @@ templateInstantiationTests() { |
var outer = templateBind(div.nodes.first); |
var model = 1; // model is missing 'foo' should throw. |
expect(() => outer.createInstance(model, new TestBindingSyntax()), |
- throwsA(isNoSuchMethodError)); |
+ throwsA(_isNoSuchMethodError)); |
}); |
test('CreateInstance - async error', () { |
@@ -2392,7 +2392,7 @@ templateInstantiationTests() { |
bool seen = false; |
runZoned(() => outer.createInstance(model, new TestBindingSyntax()), |
onError: (e) { |
- expect(e, isNoSuchMethodError); |
+ _expectNoSuchMethod(e); |
seen = true; |
}); |
return new Future(() { expect(seen, isTrue); }); |
@@ -2593,6 +2593,16 @@ compatTests() { |
}); |
} |
+// TODO(jmesserly): ideally we could test the type with isNoSuchMethodError, |
+// however dart:js converts the nSM into a String at some point. |
+// So for now we do string comparison. |
+_isNoSuchMethodError(e) => '$e'.contains('NoSuchMethodError'); |
Jennifer Messerly
2014/06/27 01:07:25
I still need to make a repro for this bug and file
Siggi Cherem (dart-lang)
2014/06/27 18:40:52
yikes!
Jennifer Messerly
2014/06/27 19:10:03
yeah :(
I actually didn't try it on dart2js ... i
|
+ |
+_expectNoSuchMethod(e) { |
+ // expect(e, isNoSuchMethodError); |
+ expect('$e', contains('NoSuchMethodError')); |
+} |
+ |
class Issue285Syntax extends BindingDelegate { |
prepareInstanceModel(template) { |
if (template.id == 'del') return (val) => val * 2; |