Skip to content

Commit

Permalink
Fix types for services (#5337)
Browse files Browse the repository at this point in the history
  • Loading branch information
pako88 committed Apr 29, 2020
1 parent c5ee329 commit 96875b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/templates/webdriverio.tpl.d.ts
Expand Up @@ -43,7 +43,7 @@ declare namespace WebdriverIO {
[key: string]: any;
}
interface ServiceWithOption extends Array<string|ServiceOption>{ 0: string; 1: ServiceOption }
type ServiceEntry = string | HookFunctions | [string, ServiceOption]
type ServiceEntry = string | HookFunctions | [string, ServiceOption] | object

interface Options {
/**
Expand Down
9 changes: 9 additions & 0 deletions tests/typings/sync/config.ts
@@ -1,3 +1,9 @@
class CustomService {
onPrepare() {
// TODO: something before all workers launch
}
}

const conf: WebdriverIO.Config = {
// can be both array and function
onComplete: (config, caps) => { },
Expand All @@ -18,6 +24,9 @@ const conf: WebdriverIO.Config = {
spawnCb: () => {}
},
skipSeleniumInstall: true
}],
[CustomService, {
someOption: true
}]
],

Expand Down
9 changes: 9 additions & 0 deletions tests/typings/webdriverio/config.ts
@@ -1,3 +1,9 @@
class CustomService {
onPrepare() {
// TODO: something before all workers launch
}
}

const config: WebdriverIO.Config = {
services: [
['selenium-standalone', {
Expand All @@ -9,6 +15,9 @@ const config: WebdriverIO.Config = {
basePath: ''
},
skipSeleniumInstall: true
}],
[CustomService, {
someOption: true
}]
],

Expand Down

0 comments on commit 96875b3

Please sign in to comment.