fancy-test icon indicating copy to clipboard operation
fancy-test copied to clipboard

Stub Typescript definition should allow functions that receive arguments.

Open ryandagg opened this issue 3 years ago • 0 comments

Version 2.2.8.

Stub should allow functions that receive arguments so that passed arguments can be tested.

This is functionally correct but throws a Typescript error.

.stub(anObject, 'functionName', (argv: string[]) => {
  expect(argv).is.eql(['some', 'thing'])
})

This should solve the issue:

stub: {
  output: {
    stubs: any[];
  };
  args: [object: any, path: any, value: (...args: any) => any];
};

ryandagg avatar Nov 08 '22 23:11 ryandagg