Closed Conrad2134 closed 3 years ago
Kudos, SonarCloud Quality Gate passed!
Merging #31 (a304e63) into master (a6c9d4f) will decrease coverage by
0.96%
. The diff coverage is100.00%
.:exclamation: Current head a304e63 differs from pull request most recent head 66cefc5. Consider uploading reports for the commit 66cefc5 to get more accurate results
@@ Coverage Diff @@
## master #31 +/- ##
==========================================
- Coverage 76.47% 75.51% -0.97%
==========================================
Files 2 2
Lines 51 49 -2
Branches 9 9
==========================================
- Hits 39 37 -2
Misses 12 12
Impacted Files | Coverage Δ | |
---|---|---|
src/client.ts | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update a6c9d4f...66cefc5. Read the comment docs.
Describe the purpose of your pull request
When calling
createClient
from Node using a destructuredrequire()
statement,createClient
will throw the following error:TypeError: Cannot read property 'createClientWithAutoPoll' of undefined
Due to TypeScript invoking
"strict mode";
for the compiled code,this
is undefined increateClient
only when invoked directly (because of the destructuring, in this case). There's a few different ways to work around this, and so it shouldn't block anyone, but this change should fix it for that case.I tested the fix with Node 14 (plain JavaScript) and TypeScript (via
ts-node
). I tried multiple styles of imports and didn't have any issues.Reproduction
I reproduced this issue by creating a
test.js
file in the repo and executing it withnode test.js
.Requirement checklist (only if applicable)