Skip to content

Fix promise on properties and refactoring - #112

Merged
ffMathy merged 16 commits into
masterfrom
fix-promise-property
May 17, 2020
Merged

Fix promise on properties and refactoring#112
ffMathy merged 16 commits into
masterfrom
fix-promise-property

Conversation

@notanengineercom

Copy link
Copy Markdown
Collaborator

Fixes #97

It's mainly a refactor pr with some bug fixes. The refactor merges the FunctionState and GetState into one class, as both classes had the same logic but spreaded around. I couldn't come up with a name for the new file and class, but I image something like GetApplyPropertyState could work?


Fixes:

  • .resolves and .rejects not working on properties
  • zero inputs in substitute methods with required return type not being treated as errors
interface Calculator {
  add(a: number, b: number): number;
}

const calculator = Substitute.for<Calculator>();
calculator.add(1, 1).returns(); // Expected at least 1 arguments, but got 0 - this was not being treated as an error before this pr

@notanengineercom
notanengineercom changed the base branch from arg-stronger-types to master May 17, 2020 13:45
@notanengineercom

Copy link
Copy Markdown
Collaborator Author

I'm thinking that maybe the SetPropertyState stuff can also be refactored in the new GetPorpertyState class, so everything is together 🤔

@ffMathy

ffMathy commented May 17, 2020

Copy link
Copy Markdown
Owner

🤩🤩🤩

@ffMathy
ffMathy merged commit d4b40ee into master May 17, 2020
@ffMathy
ffMathy deleted the fix-promise-property branch May 17, 2020 19:21
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.

Resolves and rejects functions are not implemented on properties

2 participants