You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2024. It is now read-only.
exportconstcustomTest=test.register('stubApi',stubApi);functionstubService<T>(service: T,method: keyofT, ...handlers){return{run: ()=>{test.stub((<any>service).prototype,method, ...handlers);}};}classMyService{bar(){}}// I would expect this to type error since 'foo' does not exist on MyService// however it works finecustomTest.stubService(MyService,'foo',()=>'mock foo');
I'm unsure if it's something I'm doing wrong or not but you can't even apply a typing to stubService as you get "Expected 0 type arguments". I suspect it's something to do with the way plugins are registered.
My example use case:
I'm unsure if it's something I'm doing wrong or not but you can't even apply a typing to
stubService
as you get "Expected 0 type arguments". I suspect it's something to do with the way plugins are registered.Specifically, I think here: https://github.com/oclif/fancy-test/blob/master/src/types.ts#L49 that
A extends any[]
is not enough to inferParameters<typeof stubService>
as it should.The text was updated successfully, but these errors were encountered: