Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Include returnName in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Oct 18, 2019
1 parent 3aa6caa commit 1da95f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace degenerator {
);
if (typeof fn !== 'function') {
throw new Error(
`Expected a function to be returned, but got ${typeof fn}`
`Expected a "function" to be returned for \`${returnName}\`, but got "${typeof fn}"`
);
}
if (isAsyncFunction(fn)) {
Expand Down
2 changes: 1 addition & 1 deletion test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('degenerator()', () => {
assert(err);
assert.equal(
err.message,
'Expected a function to be returned, but got number'
'Expected a "function" to be returned for `foo`, but got "number"'
);
});
});
Expand Down

0 comments on commit 1da95f5

Please sign in to comment.