Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modified rinuts to return http error - 500 incase of test failure (in…

…stead of 200 as was today)
  • Loading branch information...
commit fe6b77bc948dee294d1fa58000929456f5774ccf 1 parent 8950906
@urigolani authored
Showing with 9 additions and 8 deletions.
  1. +1 −1  Readme.md
  2. +7 −6 lib/rinuts.js
  3. +1 −1  package.json
View
2  Readme.md
@@ -73,6 +73,6 @@
identifier: *the unique identifier of the test. will be appended to the test url in the get reponse, e.g, \tests\testoddnumbers*
}
* 'runTest' (identifier, callback, context) : runs the test matching 'identifier', with 'context' if supplied in the in the POST request,
- and applies callback on the testresult.
+ and applies callback on the testresult(type Object). ''important - testresult must supply a 'success' property set to true upon test run success or false upon test run failure.
View
13 lib/rinuts.js
@@ -57,13 +57,14 @@ testService.prototype = {
self.driver.runTest(
req.params.testName,
function (err, testResult) {
- if (err) {
- res.send(err, 500);
- } else {
+ if (err || !testResult.success) {
+ res.send(err || '', 500);
+ else {
res.json(testResult);
- }
- },
- context
+ }
+ }
+ },
+ context
);
});
View
2  package.json
@@ -1,5 +1,5 @@
{ "name": "rinuts",
- "version": "0.0.3",
+ "version": "0.0.4",
"author": "Uri Golani <urigolani@gmail.com>",
"description": "A service which exposes tests through a RESTful api and allows for querying and running them, using http requests",
"dependencies": {
Please sign in to comment.
Something went wrong with that request. Please try again.