Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(property-provider): refactor memoize to use arrow functions #1281

Merged
merged 3 commits into from
Jun 22, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Jun 17, 2020

Issue #, if available:
Refactored while going through region-provider in #1280

Description of changes:
refactor memoize to use arrow functions

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2020

Codecov Report

Merging #1281 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1281      +/-   ##
==========================================
+ Coverage   73.04%   73.06%   +0.01%     
==========================================
  Files         287      287              
  Lines       12730    12736       +6     
  Branches     2922     2924       +2     
==========================================
+ Hits         9299     9305       +6     
  Misses       3431     3431              
Impacted Files Coverage Δ
packages/middleware-retry/src/defaultStrategy.ts 100.00% <100.00%> (ø)
packages/property-provider/src/memoize.ts 100.00% <100.00%> (ø)
packages/region-provider/src/defaultProvider.ts 100.00% <100.00%> (ø)
packages/region-provider/src/fromEnv.ts 100.00% <100.00%> (ø)
...kages/region-provider/src/fromSharedConfigFiles.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 5f61141...766bd99. Read the comment docs.

@trivikr
Copy link
Member Author

trivikr commented Jun 17, 2020

The unit tests in CI fails because credential-provider-node/index.spec.ts tests for functionality of memoize which it shouldn't.

Output
FAIL packages/credential-provider-node/build/index.spec.js
--
396 | ● defaultProvider › should return the same promise across invocations
397 |  
398 | expect(received).toBe(expected) // Object.is equality
399 |  
400 | If it should pass with deep equality, replace "toBe" with "toStrictEqual"
401 |  
402 | Expected: {}
403 | Received: serializes to the same string
404 |  
405 | 372 \|     expect(await provider()).toEqual(creds);
406 | 373 \|
407 | > 374 \|     expect(provider()).toBe(provider());
408 | \|                        ^
409 | 375 \|
410 | 376 \|     expect(await provider()).toEqual(creds);
411 | 377 \|     expect((fromEnv() as any).mock.calls.length).toBe(1);
412 |  
413 | at Object.it (src/index.spec.ts:374:24)

The unit test should just verify calls to memoize and chain like it's done in region-provider #1280

@trivikr trivikr merged commit 45edaed into aws:master Jun 22, 2020
@trivikr trivikr deleted the memoize-update branch June 22, 2020 20:38
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants