Skip to content

Commit

Permalink
Add tags, bump dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpereiro committed Jan 10, 2017
1 parent 3c5c69a commit c5382a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions hitit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
hitit - v0.1.0
hitit - v0.1.1
Written by Federico Pereiro (fpereiro@gmail.com) and released into the public domain.
Expand All @@ -26,6 +26,7 @@ Please refer to readme.md to read the annotated source (but not yet!).
if (teishi.stop ([
['options', o, 'object'],
function () {return [
['options.tag', o.tag, 'string'],
['options.port', o.port, ['integer', 'function', 'undefined'], 'oneOf'],
[type (o.port) === 'function', ['options.port', o.port, {min: 1, max: 65535}, teishi.test.range]],
['options.host', o.host, ['string', 'function', 'undefined'], 'oneOf'],
Expand All @@ -52,9 +53,7 @@ Please refer to readme.md to read the annotated source (but not yet!).
else return w;
}

if (type (o.headers) === 'function') o.headers = resolve (o.headers);

o.headers = dale.obj (o.headers || {}, resolve (state.headers) || {}, function (v, k) {return [k, v]});
o.headers = dale.obj (resolve (o.headers) || {}, resolve (state.headers) || {}, function (v, k) {return [k, v]});

o.body = resolve (o.body);

Expand Down Expand Up @@ -82,6 +81,7 @@ Please refer to readme.md to read the annotated source (but not yet!).

response.on ('end', function () {
var rdata = {
tag: o.tag,
code: response.statusCode,
headers: response.headers,
body: response.body,
Expand Down Expand Up @@ -147,7 +147,7 @@ Please refer to readme.md to read the annotated source (but not yet!).
preproc (seq);

var CB = function (error, data) {
log ('Starting request', (counter + 1) + '/' + fseq.length);
log ('Starting request', fseq [counter].tag, '(' + (counter + 1) + '/' + fseq.length + ')');
h.one (state, fseq [counter++], function (error, data) {
if (error) return cb (error, hist);
hist.push (data);
Expand All @@ -162,12 +162,13 @@ Please refer to readme.md to read the annotated source (but not yet!).

h.stdmap = function (req) {
return {
method: req [0],
path: req [1],
headers: req [2],
body: req [3],
code: req [4],
apres: req [5]
tag: req [0],
method: req [1],
path: req [2],
headers: req [3],
body: req [4],
code: req [5],
apres: req [6]
}
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "hitit",
"version": "0.1.0",
"version": "0.1.1",
"description": "Minimalistic tool for API testing.",
"dependencies": {
"dale": "4.1.0",
"teishi": "3.8.0"
"teishi": "3.9.0"
},
"main": "hitit.js",
"author": "Federico Pereiro <fpereiro@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hitit is a minimalistic tool for testing an HTTP API.

## Current status of the project

The current version of hitit, v0.1.0, is considered to be *unstable* and *incomplete*. [Suggestions](https://github.com/fpereiro/hitit/issues) and [patches](https://github.com/fpereiro/hitit/pulls) are welcome. Future changes planned are:
The current version of hitit, v0.1.1, is considered to be *unstable* and *incomplete*. [Suggestions](https://github.com/fpereiro/hitit/issues) and [patches](https://github.com/fpereiro/hitit/pulls) are welcome. Future changes planned are:

- Support for `multipart` uploads and downloads.
- Support for concurrent testing (a.k.a stress testing).
Expand Down

0 comments on commit c5382a0

Please sign in to comment.