ember-cli-typescript icon indicating copy to clipboard operation
ember-cli-typescript copied to clipboard

start() function isn't in @types/ember-mocha

Open richard-viney opened this issue 6 years ago • 2 comments
trafficstars

Hi,

It seems that a type for the start() function is missing from @types/ember-mocha here:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember-mocha/index.d.ts

In the app I work on we've added the following as a workaround in a .d.ts file:

declare module "ember-mocha" {
  export function start(): void
}

Version: @types/[email protected].

richard-viney avatar Jul 15 '19 08:07 richard-viney

Thanks for opening this! If you like, one of us will be happy to mentor you through getting the change into DefinitelyTyped!

chriskrycho avatar Jul 16 '19 21:07 chriskrycho

Sounds good.

On closer inspection the full type definition is actually this:

declare module "ember-mocha" {
  interface StartOptions {
    loadTests?: boolean
    startTests?: boolean
  }

  export function start(options?: StartOptions): void
}

Could also add the definition for startTests() as it is also exported by ember-mocha:

declare module "ember-mocha" {
  export function startTests(): void
}

richard-viney avatar Jul 16 '19 22:07 richard-viney

ember-mocha has since been deprecated in favor of ember-qunit. People should switch to the maintained package. While PRs will still be accepted against the DefinitelyTyped definitions, I am closing this issue as no longer relevant. Thanks!

chriskrycho avatar Sep 28 '23 22:09 chriskrycho