CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

No TypeScript definitions for the Mochawesome helper

Open rockwalrus opened this issue 3 years ago • 1 comments

What are you trying to achieve?

Have TypeScript definitions for addMochawesomeContext.

What do you get instead?

There is no Mochawesome class in the typings directory.

Provide test source code if related

declare namespace CodeceptJS {
  interface SupportObject { I: I }
  interface Methods extends  Mochawesome {}
  interface I extends WithTranslation<Mochawesome> {}
  namespace Translation {
    interface Actions {}
  }
}

Details

  • CodeceptJS version: 3.2.3
  • NodeJS Version: 16.13.0
  • Operating System: Windows 10

rockwalrus avatar Feb 08 '22 19:02 rockwalrus

I'd like to work on this if it is not picked. It would be great if you can give some hints on what to change :)

sharath2106 avatar May 26 '22 19:05 sharath2106

I just had the same problem. I have now added the following to the steps.d.ts.

class Mochawesome {
  /**
   * Use Mochawesome API inside a test.
   *
   * @param description - context string.
   */
  addMochawesomeContext(description: string): void;
}

I don't know, should I make a pull request with it. I don't know what file it fits in and if it even meets the requirements here. 😊

lucky7104 avatar Jan 03 '23 15:01 lucky7104

@lucky7104 I guess it fits in here

https://github.com/codeceptjs/CodeceptJS/blob/3.x/typings/Mocha.d.ts

kobenguyent avatar Jan 03 '23 16:01 kobenguyent