Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing typings for runner with Typescript missing. #14

Closed
eisenreich opened this issue Jan 12, 2021 · 2 comments · Fixed by #17
Closed

Missing typings for runner with Typescript missing. #14

eisenreich opened this issue Jan 12, 2021 · 2 comments · Fixed by #17

Comments

@eisenreich
Copy link

Hello,

when I use the programming interface any try to add tags to the runner, typescript does not find the typing's.

import createTestCafe from 'gherkin-testcafe';
  const testcafe = await createTestCafe();
  const runner = testcafe.createRunner();

  runner
    .src(['steps/**/*.ts', 'tests'])
    .tags(['@TAG1'])) // This method is not known.
    .browsers('chrome')
    .run({ speed: 1 });
@Arthy000
Copy link
Owner

Arthy000 commented Jan 12, 2021

Hello,

I'll see how to add them in the package as soon as I can :)

I found a way around it in my project:

export interface CustomGherkinTestcafeRunner extends Runner {
  tags(tags: string[]): CustomGherkinTestcafeRunner;
}

Then you can use it with:

const runner = (await testcafe.createRunner()) as CustomGherkinTestcafeRunner;

You can use this as a temporary solution until I fix this issue.

Arthy000 pushed a commit that referenced this issue Jan 12, 2021
when using typescript, the runner generated by createTestcafe() was of type "Runner" as defined by
testcafe, thus it did not allow the use of gherkin-testcafe functions such as tags

BREAKING CHANGE: changes to the returned types (when using typescript) might break existing
interfaces that extend the current return types

fix #14
@eisenreich
Copy link
Author

Thank you alot! :-)

Arthy000 pushed a commit that referenced this issue Jan 13, 2021
when using typescript, the runner generated by createTestcafe() was of type "Runner" as defined by
testcafe, thus it did not allow the use of gherkin-testcafe functions such as tags

BREAKING CHANGE: changes to the returned types (when using typescript) might break existing
interfaces that extend the current return types

fix #14
Arthy000 pushed a commit that referenced this issue Jan 13, 2021
when using typescript, the runner generated by createTestcafe() was of type "Runner" as defined by
testcafe, thus it did not allow the use of gherkin-testcafe functions such as tags

BREAKING CHANGE: changes to the returned types (when using typescript) might break existing
interfaces that extend the current return types

fix #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants