Add var returns
This commit is contained in:
@@ -7,7 +7,7 @@ const expect = chai.expect;
|
||||
|
||||
export const callbackErrorReporter = {
|
||||
reportNoErrorCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) {
|
||||
return <T>(f?: (value: T) => void) => {
|
||||
const callback = <T>(f?: (value: T) => void) => {
|
||||
const wrapped = (value: T) => {
|
||||
if (_.isUndefined(f)) {
|
||||
done();
|
||||
@@ -24,9 +24,10 @@ export const callbackErrorReporter = {
|
||||
};
|
||||
return wrapped;
|
||||
};
|
||||
return callback;
|
||||
},
|
||||
reportNodeCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) {
|
||||
return <T>(f?: (value: T) => void) => {
|
||||
const callback = <T>(f?: (value: T) => void) => {
|
||||
const wrapped = (error: Error | null, value: T | undefined) => {
|
||||
if (!_.isNull(error)) {
|
||||
done(error);
|
||||
@@ -47,6 +48,7 @@ export const callbackErrorReporter = {
|
||||
};
|
||||
return wrapped;
|
||||
};
|
||||
return callback;
|
||||
},
|
||||
assertNodeCallbackError(done: DoneCallback, errMsg: string) {
|
||||
const wrapped = <T>(error: Error | null, value: T | undefined) => {
|
||||
|
Reference in New Issue
Block a user