use Promise instead of Future
This commit is contained in:
@@ -16,7 +16,7 @@ class Expect extends gns.Expect {
|
||||
Expect(actual) : super(actual);
|
||||
|
||||
void toThrowError(message) => this.toThrowWith(message: message);
|
||||
void toBeFuture() => _expect(actual is Future, equals(true));
|
||||
void toBePromise() => _expect(actual is Future, equals(true));
|
||||
Function get _expect => gns.guinness.matchers.expect;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ window.print = function(msg) {
|
||||
|
||||
window.beforeEach(function() {
|
||||
jasmine.addMatchers({
|
||||
toBeFuture: function() {
|
||||
toBePromise: function() {
|
||||
return {
|
||||
compare: function (actual, expectedClass) {
|
||||
var pass = typeof actual === 'object' && typeof actual.then === 'function';
|
||||
return {
|
||||
pass: pass,
|
||||
get message() {
|
||||
return 'Expected ' + actual + ' to be a future';
|
||||
return 'Expected ' + actual + ' to be a promise';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user