mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
38 lines
933 B
JavaScript
38 lines
933 B
JavaScript
var extend = require('raptor-util/extend');
|
|
var expect = require('chai').expect;
|
|
|
|
exports.templateData = {
|
|
outer: function(callback) {
|
|
setTimeout(function() {
|
|
callback(null, {});
|
|
}, 400);
|
|
},
|
|
inner1: function(callback) {
|
|
setTimeout(function() {
|
|
callback(null, {});
|
|
}, 500);
|
|
},
|
|
inner2: function(callback) {
|
|
setTimeout(function() {
|
|
callback(null, {});
|
|
}, 600);
|
|
}
|
|
};
|
|
|
|
exports.checkHtml = function() {}
|
|
exports.checkEvents = function(events, helpers) {
|
|
events = events.map(function(eventInfo) {
|
|
var arg = extend({}, eventInfo.arg);
|
|
expect(arg.out != null).to.equal(true);
|
|
|
|
delete arg.out; // Not serializable
|
|
delete arg.asyncValue; // Not serializable
|
|
|
|
return {
|
|
event: eventInfo.event,
|
|
arg: arg
|
|
};
|
|
});
|
|
|
|
helpers.compare(events, '-events.json');
|
|
}; |