mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
26 lines
626 B
JavaScript
26 lines
626 B
JavaScript
Meteor.startup(function () {
|
|
Meteor._ServerTestResults.remove();
|
|
});
|
|
|
|
App.publish('tinytest/results', function (sub, params) {
|
|
return Meteor._ServerTestResults.find({run_id: params.run_id});
|
|
});
|
|
|
|
App.methods({
|
|
'tinytest/run': function (run_id) {
|
|
var request = this;
|
|
request.beginAsync();
|
|
|
|
var reportFunc = function (report) {
|
|
Meteor._ServerTestResults.insert({run_id: run_id, report: report});
|
|
};
|
|
|
|
var testRun = Meteor._TestManager.createRun(reportFunc);
|
|
test._currentRun.withValue(testRun, function () {
|
|
testRun.run(function () {
|
|
request.respond();
|
|
});
|
|
});
|
|
}
|
|
});
|