Skip to content

Mocking of "Sub"-Components #254

Answered by egil
dev-in-disguise asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dev-in-disguise

Mocking of components is on the TODO list. It is unfortunately not something that is available right now, see #53 and #17.

You already discovered diff:ignore which is the best option right now.

As for services, while we wait for mocking of components, the easiest approach is to have a common setup methods for all your tests in a test class (when using xunit you can use the constructor) and just register a mock of the service your inner component needs.

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dev-in-disguise
Comment options

Answer selected by egil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants