spectator
spectator copied to clipboard
setInput was removed?
Is this a regression?
Yes
Description
Upgrading from v16 to v18, and now I am getting errors like this:
Error: src/app/shared/value-input/list-editor.component.spec.ts:272:12 - error TS2339: Property 'setInput' does not exist on type 'SpectatorHost<ListEditorComponent, ListEditorHostComponent>'.
272 host.setInput({subType: TypeInfoString});
I did not see any breaking changes in the changelog for this - just for props/setProps.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
No
@NetanelBasal @dirkluijk Do you have any thoughts on this issue?
@NetanelBasal @dirkluijk Do you have any thoughts on this issue?
I migrated my unit tests from setInput to setHostInput. In some cases I had to add a host component for tests where I previously didn't have one.
If this was intended, then I think the main issue here is that the list of breaking changes in the changelog did not include this.
Well, that sucks. That means i have to change at least 5k unit test files. That's ridiculous! Could we have another solution?
@NetanelBasal @dirkluijk Can it be a regression bug?
@crfrolik So you had to add some boilerplate code (host component, i.e. ), isn't? I don't want to criticize, but I think your solution isn't good at all. We chose spectator, because it could get rid of writing that boilerplate code
It seems you can set a value directly into the input. I'm testing directives and I found that spectator.directive.<input> = <value> works fine.