Cast result of all wd method to Bluebird promises #626
Conversation
а зачем это? |
@j0tunn |
need some tests for |
@sipayRT готово |
}); | ||
|
||
wrapped = wd.promiseRemote(); | ||
sandbox = sinon.sandbox.create(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынеси из beforeEach
, плз - ты ведь ресторишь его в afterEach
и не изменяешь по ходу тестов
}); | ||
|
||
afterEach(() => { | ||
sandbox.restore(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в одну строчку можно
в остальном ок |
sandbox.restore(); | ||
}); | ||
|
||
it('should cast original promise to Blubird', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...to Bluebird
|
||
if (EventEmitter.prototype[methodName]) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему так не написать:
if (Object.prototype[methodName] || EventEmitter.prototype[methodName]) {
return false;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
раздельно лучше читаются условия
exports.promiseRemote = (gridUrl) => { | ||
const remote = wd.promiseRemote(gridUrl); | ||
|
||
const bluebirdRemote = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем тут пробел между переменными?
Introduce small wd-bluebird module, which just wraps existing wd methods and cast the result to Blubird promise.
ded8922
to
c98b9fa
Compare
Introduce small wd-bluebird module, which just wraps existing
wd methods and cast the result to Blubird promise.
/cc @sipayRT @j0tunn @DudaGod