Skip to content

Commit

Permalink
fix Suite and Test typings for #3495 (#3497)
Browse files Browse the repository at this point in the history
## Proposed changes

fix Suite and Test typings 

## Types of changes

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist

- [x] I have read the [CONTRIBUTING](https://github.com/webdriverio/webdriverio/blob/master/CONTRIBUTING.md) doc
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)

## Further comments

#3495

### Reviewers: @webdriverio/technical-committee
  • Loading branch information
mgrybyk authored and christian-bromann committed Feb 5, 2019
1 parent 2c5c4dc commit c2b784d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions packages/wdio-jasmine-framework/jasmine-framework.d.ts
@@ -1,6 +1,6 @@
/// <reference types="jasmine"/>

declare namespace WebDriverIO {
declare namespace WebdriverIO {
interface Suite {
title: string;
fullName: string;
Expand All @@ -11,4 +11,8 @@ declare namespace WebDriverIO {
parent: string;
passed: boolean;
}
}
}

declare module "@wdio/jasmine-framework" {
export default WebdriverIO
}
11 changes: 8 additions & 3 deletions packages/wdio-mocha-framework/mocha-framework.d.ts
@@ -1,7 +1,8 @@
/// <reference types="mocha"/>

declare namespace WebDriverIO {
declare namespace WebdriverIO {
interface Suite {
file: string;
title: string;
parent: string;
fullTitle: string;
Expand All @@ -11,6 +12,10 @@ declare namespace WebDriverIO {
interface Test extends Suite {
currentTest: string;
passed: boolean;
duration: any;
duration?: number;
}
}
}

declare module "@wdio/mocha-framework" {
export default WebdriverIO
}
@@ -1,6 +1,6 @@
import { InstallOpts, StartOpts } from "selenium-standalone";

declare namespace WebdriverIO {
declare module "webdriverio" {
interface Config {
seleniumLogs?: string;
seleniumInstallArgs?: InstallOpts;
Expand Down
7 changes: 5 additions & 2 deletions scripts/templates/webdriverio.tpl.d.ts
Expand Up @@ -56,7 +56,7 @@ declare namespace WebdriverIO {
alpha?: number,
type?: string,
rgba?: string
}
}
}

interface Options {
Expand All @@ -80,6 +80,9 @@ declare namespace WebdriverIO {
execArgv?: string[]
}

interface Suite {}
interface Test {}

interface Hooks {

onPrepare?(
Expand Down Expand Up @@ -191,7 +194,7 @@ declare namespace WebdriverIO {

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

type Config = Options & Omit<WebDriver.Options, "capabilities"> & Hooks;
interface Config extends Options, Omit<WebDriver.Options, "capabilities">, Hooks {}
}

declare var browser: WebDriver.Client<void> & WebdriverIO.Browser<void>;
Expand Down

0 comments on commit c2b784d

Please sign in to comment.