Fixing tests

This commit is contained in:
Mathew Kurian 2016-01-22 15:16:06 -06:00
parent 3766f58d5f
commit cd4b8df554
2 changed files with 16 additions and 6 deletions

View file

@ -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());
```

View file

@ -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();