diff --git a/README.md b/README.md index d15c589..53ee71e 100644 --- a/README.md +++ b/README.md @@ -51,5 +51,6 @@ Refer to [`examples`](/examples) Documentation coming in the future ```js -console.pipe(expose, 'bash',new Inspector(), new DefaultConsole()); +// console.pipe(expose, name, ...throughs); +console.pipe('log', 'bash',new Inspector(), new DefaultConsole()); ``` \ No newline at end of file diff --git a/tests/console-express.test.js b/tests/console-express.test.js index c150dad..fbef118 100644 --- a/tests/console-express.test.js +++ b/tests/console-express.test.js @@ -1,7 +1,7 @@ import Scribe from '../' import express from 'express' import expect from 'expect.js' -import fetch from 'node-fetch' +import request from 'superagent' import async from 'async' describe('Basic Scribe', ()=> { @@ -32,10 +32,19 @@ describe('Basic Scribe', ()=> { console.log(`Listening on ${port}`); async.each(new Array(requestsCount), (i, callback)=> { - fetch(`http://localhost:${port}/test`) - .then(res => res.text()) - .then(text => console.log(`Received response ${++count}/${requestsCount}`, text)) - .then(()=> callback()); + count++; + + request + .get(`http://localhost:${port}/test`) + .end((err, req)=> { + if (err) { + return callback(); + } else { + console + .log(`Received response ${count}/${requestsCount}`, req.body) + .then(()=>callback()); + } + }); }, () => { expect(count).to.equal(requestsCount); done();