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

Cache break of MockComponent #96

Closed
satanTime opened this issue Mar 22, 2020 · 2 comments · Fixed by #192
Closed

Cache break of MockComponent #96

satanTime opened this issue Mar 22, 2020 · 2 comments · Fixed by #192

Comments

@satanTime
Copy link
Member

Unfortunately, there's an issue with cached component because cache doesn't respect 2nd argument of MockComponent and we have the same problem as MockPipe has when we pass there different transformers.

df56334

A possible solution is to redo this feature in a proper way.

@askarby, could you provide a test sample how you use it in your project?

@satanTime
Copy link
Member Author

satanTime commented Apr 3, 2020

Hi @ike18t,

I hope you are fine.

I was thinking about df56334 and, being honest, can't find a way how to reimplement it with the correct cache support.

Because

MockComponent(MyComponent, {template: 'a'});

and

MockComponent(MyComponent, {template: 'b'});

and

MockComponent(MyComponent);

simply don't work all together.

We can implement createMockComponent(), createMockDirective() etc. as a replacement of the requested functionality, but still I don't understand the goal of providing totally different config for an existing component. If we want to replace the original component with something totally custom - now it can be achieved with MockBuilder.replace.

Please let me know your decision and I'll prepare either pure revert or revert + createMock... functions.

@satanTime
Copy link
Member Author

Hi @askarby,

might you provide an example how you use it? Unfortunately, otherwise I need to deprecate it and remove in v11.

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 a pull request may close this issue.

1 participant