forked from mirrors/Scribe.js
Fixing tests
This commit is contained in:
parent
3766f58d5f
commit
cd4b8df554
2 changed files with 16 additions and 6 deletions
|
@ -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());
|
||||
```
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue