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

Fix mock middleware types #822

merged 3 commits into from
Jul 21, 2020

Fix mock middleware types #822

merged 3 commits into from
Jul 21, 2020


Copy link

@maier49 maier49 commented Jul 21, 2020

Type: bug

The following has been addressed in the PR:

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.

Copy link

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

Copy link

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.

tests/testing/unit/harness/harness.tsx Outdated Show resolved Hide resolved
@maier49 maier49 changed the title Fix harness mock middleware type Fix mock middleware types Jul 21, 2020
Copy link

@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 <>
Co-authored-by: Anthony Gubler <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants