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

tighten TraceArchive type to more strictly enforce correct state #623

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tklever
Copy link
Contributor

@tklever tklever commented Aug 23, 2020

Which problem is this PR solving?

  • TraceArchive is a type with all optional parameters, this change allows typescript to more helpfully enforce correct object structures.

Short description of the changes

  • Under the previous type definition for TraceArchive the following are examples of types that would have been valid but do not make a ton of sense (or outright break). {}, {isLoading: true, isError: true}, {isError: true, error: undefined}, {isArchived: true, isError: true, isLoading: true}.
  • These new stricter type definitions free developers from testing edge cases of undesired object structure, typescript simply won't build the app.
  • I tested these changes against the additional tests in Adding tests around existing ArchiveNotifier duck #622, if you want to review that first and rebase these changes on top of it, I can and will.

Signed-off-by: Tim Klever <Tim.V.Klever@aexp.com>
@codecov
Copy link

codecov bot commented Aug 23, 2020

Codecov Report

Merging #623 (2eed4a7) into master (551db4c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #623   +/-   ##
=======================================
  Coverage   94.23%   94.23%           
=======================================
  Files         228      228           
  Lines        5930     5931    +1     
  Branches     1448     1449    +1     
=======================================
+ Hits         5588     5589    +1     
  Misses        308      308           
  Partials       34       34           
Impacted Files Coverage Δ
.../src/components/TracePage/ArchiveNotifier/duck.tsx 100.00% <100.00%> (ø)
...src/components/TracePage/ArchiveNotifier/index.tsx 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 551db4c...2eed4a7. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants