Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
fix: implemented logMessage (#5), fixed #3
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj committed Apr 26, 2013
1 parent 655128a commit 07340db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/adapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
window.__karma__.start = function() {};
window.onerror = function(e) {
window.console.error(e);
window.__karma__.error(e);
}
21 changes: 20 additions & 1 deletion static/adapter.dart.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,30 @@ class AdapterConfigutation extends unittest.Configuration {
'suite': [],
'skipped': !testCase.enabled,
'log': log,
'time': new DateTime.now().difference(testCase.startTime).inMilliseconds
'time': testCase.runningTime.inMilliseconds
})
);
});
}

void onLogMessage(TestCase testCase, String message) {
js.scoped(() {
js.context.__karma__.info(js.map({
'dump': message
}));
});
}

void onSummary(int passed, int failed, int errors, List<TestCase> results,
String uncaughtError) {
if (uncaughtError != null) {
js.scoped(() {
js.context.__karma__.error(uncaughtError);
});
}
// it's OK to print the default summary into the console
super.onSummary(passed, failed, errors, results, uncaughtError);
}
}

main() {
Expand Down

0 comments on commit 07340db

Please sign in to comment.