Skip to content

Commit

Permalink
remove current Moon API from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 21, 2018
1 parent 2ec94b4 commit 166dc84
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions test/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ if(document.getElementById("moon-els")) {
var expect = chai.expect;

// Stop logs
var noop = Moon.util.noop;
console.log = console.error = noop;

// Cover errors
Moon.util.log("Test");
Moon.util.error("Test");
console.log = console.error = function() {};

var createTestElement = function(id, html) {
var el = document.createElement("div");
Expand All @@ -50,19 +45,19 @@ var captureError = function(fn) {
}
}

var wait = function(cb) {
return new Promise(function(resolve, reject) {
Moon.nextTick(function() {
try {
if(cb.toString().indexOf("done") !== -1) {
cb(resolve);
} else {
cb();
resolve();
}
} catch(err) {
reject(err);
}
});
});
}
// var wait = function(cb) {
// return new Promise(function(resolve, reject) {
// Moon.after(function() {
// try {
// if(cb.toString().indexOf("done") !== -1) {
// cb(resolve);
// } else {
// cb();
// resolve();
// }
// } catch(err) {
// reject(err);
// }
// });
// });
// }

0 comments on commit 166dc84

Please sign in to comment.