Skip to content

Fix mock middleware types#822

Merged
maier49 merged 3 commits into
dojo:masterfrom
maier49:fix-harness-type
Jul 21, 2020
Merged

Fix mock middleware types#822
maier49 merged 3 commits into
dojo:masterfrom
maier49:fix-harness-type

Conversation

@maier49
Copy link
Copy Markdown
Contributor

@maier49 maier49 commented Jul 21, 2020

Type: bug

The following has been addressed in the PR:

Description:
Exclude<keyof X, 'Y'> returns a unioned string type not the object type. Normally using Omit or Pick would fix that but In the case of the MiddlewareResultFactory the type is never becuase the call signature isn't a key.

This changes the mocked middleware type to the call signature itself.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Jul 21, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4e4cf01:

Sandbox Source
dojo/dojo-codesandbox-template Configuration

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 21, 2020

Codecov Report

Merging #822 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #822      +/-   ##
==========================================
+ Coverage   97.53%   97.57%   +0.03%     
==========================================
  Files         127      127              
  Lines        7964     7964              
  Branches     1836     1836              
==========================================
+ Hits         7768     7771       +3     
+ Misses        196      193       -3     
Impacted Files Coverage Δ
src/testing/harness/harness.ts 93.87% <ø> (+2.04%) ⬆️
src/testing/renderer.ts 97.64% <ø> (ø)

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 48c87ed...4e4cf01. Read the comment docs.

Comment thread tests/testing/unit/harness/harness.tsx Outdated
@maier49 maier49 changed the title Fix harness mock middleware type Fix mock middleware types Jul 21, 2020
Copy link
Copy Markdown
Member

@agubler agubler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing, I think there is a DefaultMiddlewareFactory type that you could use instead of MiddlewareResult<any, any, any, any>

@maier49 maier49 merged commit da89059 into dojo:master Jul 21, 2020
@maier49 maier49 deleted the fix-harness-type branch July 21, 2020 19:43
tomdye pushed a commit to tomdye/framework that referenced this pull request Sep 23, 2020
@tomdye tomdye mentioned this pull request Sep 23, 2020
tomdye added a commit that referenced this pull request Sep 23, 2020
* Handle ignored children in decorate (#840)

* Allow finding and modifying wrapped widgets in functional children (#780)

* Add function to create "typed" version of middleware (#819)

* Add factory function to middleware for adding types

* change to withType

* Fix mock middleware types (#822)

* Wrap children result in an array if not already in one (#844)

* wrap children result in an array if not already in one

* add test for wrapped children

* update assert render unit test (#820)

Co-authored-by: Bradley Maier <bmaier@sitepen.com>
Co-authored-by: Anthony Gubler <agubler@sitepen.com>
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.

3 participants