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
|
Documentation coming in the future
|
||||||
|
|
||||||
```js
|
```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 Scribe from '../'
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
import expect from 'expect.js'
|
import expect from 'expect.js'
|
||||||
import fetch from 'node-fetch'
|
import request from 'superagent'
|
||||||
import async from 'async'
|
import async from 'async'
|
||||||
|
|
||||||
describe('Basic Scribe', ()=> {
|
describe('Basic Scribe', ()=> {
|
||||||
|
@ -32,10 +32,19 @@ describe('Basic Scribe', ()=> {
|
||||||
console.log(`Listening on ${port}`);
|
console.log(`Listening on ${port}`);
|
||||||
|
|
||||||
async.each(new Array(requestsCount), (i, callback)=> {
|
async.each(new Array(requestsCount), (i, callback)=> {
|
||||||
fetch(`http://localhost:${port}/test`)
|
count++;
|
||||||
.then(res => res.text())
|
|
||||||
.then(text => console.log(`Received response ${++count}/${requestsCount}`, text))
|
request
|
||||||
.then(()=> callback());
|
.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);
|
expect(count).to.equal(requestsCount);
|
||||||
done();
|
done();
|
||||||
|
|
Loading…
Add table
Reference in a new issue