Skip to content

Commit

Permalink
Merge branch 'master' into #458-tasks-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Feb 23, 2018
2 parents edfe209 + 07d66e0 commit 31cab8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
2 changes: 0 additions & 2 deletions lib/stream.js
Expand Up @@ -105,8 +105,6 @@ function $stream(ctx, qs, initCB, config) {

function getContext() {
let client;
// TODO: Need to fix the test for this piece + the code
// istanbul ignore else
if (ctx.db) {
client = ctx.db.client;
} else {
Expand Down
32 changes: 9 additions & 23 deletions test/eventSpec.js
Expand Up @@ -430,42 +430,28 @@ describe('Error event', function () {

if (!options.pgNative) {
describe('for loose stream requests', () => {
/*
let error, r, context, counter = 0;
let r, sco;
beforeEach(done => {
options.error = (err, e) => {
counter++;
error = err;
context = e;
};
const qs = new QueryStream('select $1::int', [123]);
const qs = new QueryStream('select * from users');
db.connect()
.then(obj => {
const query = obj.stream(qs, s => {
sco = obj;
return sco.stream(qs, s => {
s.pipe(JSONStream.stringify());
obj.done();
throw new Error('Something went wrong here');
});
obj.done();
return query;
})
.then(() => {
// TODO: This one is currently called by error
})
.catch(reason => {
//sco.done();
r = reason;
})
.finally(done);
done();
});
});
it('must notify with correct error', () => {
expect(error instanceof Error).toBe(true);
expect(r instanceof Error).toBe(true);
expect(error.message).toBe($text.looseQuery);
expect(r.message).toBe($text.looseQuery);
expect(context.query).toBe('select $1::int');
expect(context.client).toBeUndefined();
expect(context.params).toEqual(['123']);
expect(counter).toBe(1);
});
*/
});
}

Expand Down

0 comments on commit 31cab8c

Please sign in to comment.