stephenplusplus / google-auto-auth

Making it as easy as possible to authenticate a Google API request
MIT License
34 stars 9 forks source link

test: fix re-use existing authClient test #23

Closed ofrobots closed 7 years ago

ofrobots commented 7 years ago

I believe this got broken by https://github.com/stephenplusplus/google-auto-auth/pull/21.

stephenplusplus commented 7 years ago

Can you explain more how this was broken? It also doesn't seem like the test that's been changed is still testing what it says it is (re-using a cached auth client).

ofrobots commented 7 years ago

With #21, if an authClient exists, we simply return it. The test was mocking authClient but and expecting authClientPromise would resolve to the mocked value of authClient.

stephenplusplus commented 7 years ago

Is this line tested anywhere? https://github.com/stephenplusplus/google-auto-auth/blob/ac4daa66d68d0280cc6b7345fee2583ad838de37/index.js#L111

ofrobots commented 7 years ago

Not only was that line untested, it was unreachable. PTAL.

ofrobots commented 7 years ago

Actually it still might benefit from an additional test. Adding.