2014-09-25 14:04:46 -07:00
|
|
|
export var describe = window.describe;
|
2014-10-01 22:05:46 -07:00
|
|
|
export var xdescribe = window.xdescribe;
|
2014-09-28 13:55:01 -07:00
|
|
|
export var ddescribe = window.ddescribe;
|
2014-09-25 14:04:46 -07:00
|
|
|
export var it = window.it;
|
2014-10-01 22:05:46 -07:00
|
|
|
export var xit = window.xit;
|
2014-09-28 13:55:01 -07:00
|
|
|
export var iit = window.iit;
|
2014-09-25 14:04:46 -07:00
|
|
|
export var beforeEach = window.beforeEach;
|
|
|
|
export var afterEach = window.afterEach;
|
|
|
|
export var expect = window.expect;
|
|
|
|
|
|
|
|
// To make testing consistent between dart and js
|
2014-09-26 17:38:38 -07:00
|
|
|
window.print = function(msg) {
|
|
|
|
if (window.dump) {
|
|
|
|
window.dump(msg);
|
|
|
|
} else {
|
|
|
|
window.console.log(msg);
|
|
|
|
}
|
|
|
|
};
|
2014-09-30 14:56:33 -04:00
|
|
|
|
|
|
|
window.beforeEach(function() {
|
|
|
|
jasmine.addMatchers({
|
2014-10-10 15:44:56 -04:00
|
|
|
toBePromise: function() {
|
2014-09-30 14:56:33 -04:00
|
|
|
return {
|
|
|
|
compare: function (actual, expectedClass) {
|
|
|
|
var pass = typeof actual === 'object' && typeof actual.then === 'function';
|
|
|
|
return {
|
|
|
|
pass: pass,
|
|
|
|
get message() {
|
2014-10-10 15:44:56 -04:00
|
|
|
return 'Expected ' + actual + ' to be a promise';
|
2014-09-30 14:56:33 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
toBeAnInstanceOf: function() {
|
|
|
|
return {
|
|
|
|
compare: function(actual, expectedClass) {
|
|
|
|
var pass = typeof actual === 'object' && actual instanceof expectedClass;
|
|
|
|
return {
|
|
|
|
pass: pass,
|
|
|
|
get message() {
|
|
|
|
return 'Expected ' + actual + ' to be an instance of ' + expectedClass;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|