Skip to content

Commit

Permalink
Merge pull request #32 from testing-library/fix-typescript-compilatio…
Browse files Browse the repository at this point in the history
…n-when-checking-libs

fix: typescript compilation when checking libs
  • Loading branch information
olivierwilkinson authored Sep 13, 2021
2 parents e907070 + 65d1d60 commit f88c054
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"@types/simmerjs": "^0.5.1",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"@wdio/cli": "^7.9.0",
"@wdio/local-runner": "^7.9.0",
"@wdio/mocha-framework": "^7.9.0",
"@wdio/selenium-standalone-service": "^7.9.0",
"@wdio/spec-reporter": "^7.9.0",
"@wdio/sync": "^7.9.0",
"@wdio/cli": "^7.12.1",
"@wdio/local-runner": "^7.12.1",
"@wdio/mocha-framework": "^7.12.0",
"@wdio/selenium-standalone-service": "^7.10.1",
"@wdio/spec-reporter": "^7.10.1",
"@wdio/sync": "^7.12.1",
"eslint": "^7.6.0",
"kcd-scripts": "^11.1.0",
"npm-run-all": "^4.1.5",
"semantic-release": "^17.0.2",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
"typescript": "^4.4.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function setupBrowser(browser: BrowserBase): WebdriverIOQueries {
...args: Parameters<WebdriverIOQueries[QueryName]>
) => {
const body = await browser.$('body')
return within(body)[queryName](...(args as any[]))
return within(body as ElementBase)[queryName](...(args as any[]))
}

// add query to response queries
Expand Down
2 changes: 1 addition & 1 deletion src/wdio-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ eslint-disable @typescript-eslint/no-explicit-any,

declare global {
namespace WebdriverIO {
interface Element extends ElementBase {}
interface Element {}
}
}

Expand Down
5 changes: 3 additions & 2 deletions test/async/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest", "webdriverio/async", "@wdio/mocha-framework"],
"baseUrl": "."
"types": ["node", "webdriverio/async", "@wdio/mocha-framework", "expect-webdriverio"],
"baseUrl": ".",
"skipLibCheck": false
},
"exclude": [],
"include": ["**/*.ts"]
Expand Down
3 changes: 2 additions & 1 deletion test/sync/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest", "webdriverio/sync", "@wdio/mocha-framework"]
"types": ["node", "webdriverio/sync", "@wdio/mocha-framework", "expect-webdriverio"],
"skipLibCheck": false
},
"exclude": [],
"include": ["**/*.ts"]
Expand Down

0 comments on commit f88c054

Please sign in to comment.