Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Mar 10, 2022
1 parent 281742f commit 2c8efef
Show file tree
Hide file tree
Showing 34 changed files with 832 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

npx run-s compile
npm run compile
1,783 changes: 791 additions & 992 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"devDependencies": {
"@types/jasmine": "^3.10.1",
"@types/jest": "^27.0.2",
"@types/node": "^17.0.5",
"@types/node": "^15.14.0",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"eslint": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/matchers/browser/toHaveTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export function toHaveTitleFn(browser: WebdriverIO.Browser, title: string, optio
}

export function toHaveTitle(...args: any): any {
return runExpect.call(this, toHaveTitleFn, args)
return runExpect.call(this || {}, toHaveTitleFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/browser/toHaveTitleContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function toHaveTitleContainingFn(browser: WebdriverIO.Browser, title: string, op
}

export function toHaveTitleContaining(...args: any): any {
return runExpect.call(this, toHaveTitleContainingFn, args)
return runExpect.call(this || {}, toHaveTitleContainingFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/browser/toHaveUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export function toHaveUrlFn(browser: WebdriverIO.Browser, url: string, options:
}

export function toHaveUrl(...args: any): any {
return runExpect.call(this, toHaveUrlFn, args)
return runExpect.call(this || {}, toHaveUrlFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/browser/toHaveUrlContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function toHaveUrlContainingFn(browser: WebdriverIO.Browser, url: string, option
}

export function toHaveUrlContaining(...args: any): any {
return runExpect.call(this, toHaveUrlContainingFn, args)
return runExpect.call(this || {}, toHaveUrlContainingFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toBeClickable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ function toBeClickableFn(received: WebdriverIO.Element | WebdriverIO.ElementArra
}

export function toBeClickable(...args: any) {
return runExpect.call(this, toBeClickableFn, args)
return runExpect.call(this || {}, toBeClickableFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toBeDisabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ function toBeDisabledFn(received: WdioElementMaybePromise, options: ExpectWebdri
}

export function toBeDisabled(...args: any): any {
return runExpect.call(this, toBeDisabledFn, args)
return runExpect.call(this || {}, toBeDisabledFn, args)
}
4 changes: 2 additions & 2 deletions src/matchers/element/toBeDisplayed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ function toBeDisplayedFn(received: WdioElementMaybePromise, options: ExpectWebdr
}

export function toBeDisplayed(...args: any): any {
return runExpect.call(this, toBeDisplayedFn, args)
}
return runExpect.call(this || {}, toBeDisplayedFn, args)
}
4 changes: 2 additions & 2 deletions src/matchers/element/toBeDisplayedInViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ function toBeDisplayedInViewportFn(received: WebdriverIO.Element | WebdriverIO.E
}

export function toBeDisplayedInViewport(...args: any): any {
return runExpect.call(this, toBeDisplayedInViewportFn, args)
}
return runExpect.call(this || {}, toBeDisplayedInViewportFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toBeEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ function toBeEnabledFn(received: WebdriverIO.Element | WebdriverIO.ElementArray,
}

export function toBeEnabled(...args: any): any {
return runExpect.call(this, toBeEnabledFn, args)
return runExpect.call(this || {}, toBeEnabledFn, args)
}

2 changes: 1 addition & 1 deletion src/matchers/element/toBeExisting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function toExistFn(received: WdioElementMaybePromise, options: ExpectWebdriverIO
}

export function toExist(...args: any): any {
return runExpect.call(this, toExistFn, args)
return runExpect.call(this || {}, toExistFn, args)
}

export function toBeExisting(el: WdioElementMaybePromise, options?: ExpectWebdriverIO.CommandOptions): any {
Expand Down
2 changes: 1 addition & 1 deletion src/matchers/element/toBeFocused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ function toBeFocusedFn(received: WebdriverIO.Element | WebdriverIO.ElementArray,
}

export function toBeFocused(...args: any): any {
return runExpect.call(this, toBeFocusedFn, args)
return runExpect.call(this || {}, toBeFocusedFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toBeSelected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function toBeSelectedFn(received: WebdriverIO.Element | WebdriverIO.ElementArray
}

export function toBeSelected(...args: any): any {
return runExpect.call(this, toBeSelectedFn, args)
return runExpect.call(this || {}, toBeSelectedFn, args)
}

export function toBeChecked (el: WebdriverIO.Element, options: ExpectWebdriverIO.CommandOptions): any {
Expand Down
8 changes: 4 additions & 4 deletions src/matchers/element/toHaveAttribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function toHaveAttributeAndValueFn(received: WebdriverIO.Element | Webdri

const expected = wrapExpectedWithArray(el, attr, value)
const message = enhanceError(el, expected, attr, this, verb, expectation, attribute, options)

return {
pass,
message: (): string => message
Expand All @@ -52,7 +52,7 @@ export function toHaveAttributeFn(received: WebdriverIO.Element | WebdriverIO.El

return browser.call(async () => {
let el = await received

const pass = await waitUntil(async () => {
const result = await executeCommand.call(this, el, conditionAttr, {}, [attribute])
el = result.el
Expand All @@ -74,10 +74,10 @@ export function toHaveAttributeFn(received: WebdriverIO.Element | WebdriverIO.El
export function toHaveAttribute(...args: any): any {
if(args.length===3 || args.length===4 ) {
// Name and value is passed in e.g. el.toHaveAttribute('attr', 'value', (opts))
return runExpect.call(this, toHaveAttributeAndValueFn, args)
return runExpect.call(this || {}, toHaveAttributeAndValueFn, args)
} else {
// Only name is passed in e.g. el.toHaveAttribute('attr')
return runExpect.call(this, toHaveAttributeFn, args)
return runExpect.call(this || {}, toHaveAttributeFn, args)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveAttributeContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function toHaveAttributeContainingFn(el: WebdriverIO.Element, attribute: string,
}

export function toHaveAttributeContaining(...args: any): any {
return runExpect.call(this, toHaveAttributeContainingFn, args)
return runExpect.call(this || {}, toHaveAttributeContainingFn, args)
}

export const toHaveAttrContaining = toHaveAttributeContaining
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ function toHaveChildrenFn(received: WebdriverIO.Element | WebdriverIO.ElementArr
}

export function toHaveChildren(...args: any): any {
return runExpect.call(this, toHaveChildrenFn, args)
return runExpect.call(this || {}, toHaveChildrenFn, args)
}
4 changes: 2 additions & 2 deletions src/matchers/element/toHaveElementClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function toHaveElementClassFn(received: WebdriverIO.Element | WebdriverIO.Elemen
}

export function toHaveElementClass(...args: any): any {
return runExpect.call(this, toHaveElementClassFn, args)
return runExpect.call(this || {}, toHaveElementClassFn, args)
}

/**
Expand All @@ -70,5 +70,5 @@ export function toHaveElementClass(...args: any): any {
*/
export function toHaveClass(...args: any): any {
console.warn('expect(...).toHaveClass is deprecated and will be removed in next release. Use toHaveElementClass instead.')
return runExpect.call(this, toHaveElementClassFn, args)
return runExpect.call(this || {}, toHaveElementClassFn, args)
}
4 changes: 2 additions & 2 deletions src/matchers/element/toHaveElementClassContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function toHaveElementClassContainingFn(el: WebdriverIO.Element, className: stri
}

export function toHaveElementClassContaining(...args: any): any {
return runExpect.call(this, toHaveElementClassContainingFn, args)
return runExpect.call(this || {}, toHaveElementClassContainingFn, args)
}

/**
Expand All @@ -20,5 +20,5 @@ export function toHaveElementClassContaining(...args: any): any {
*/
export function toHaveClassContaining(...args: any): any {
console.warn('expect(...).toHaveClassContaining is deprecated and will be removed in next release. Use toHaveElementClassContaining instead.')
return runExpect.call(this, toHaveElementClassContainingFn, args)
return runExpect.call(this || {}, toHaveElementClassContainingFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveElementProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ export function toHaveElementPropertyFn(
}

export function toHaveElementProperty(...args: any): any {
return runExpect.call(this, toHaveElementPropertyFn, args)
return runExpect.call(this || {}, toHaveElementPropertyFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveHref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function toHaveHrefFn(el: WebdriverIO.Element, href: string, options: Exp
}

export function toHaveHref(...args: any): any {
return runExpect.call(this, toHaveHrefFn, args)
return runExpect.call(this || {}, toHaveHrefFn, args)
}

export const toHaveLink = toHaveHref
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveHrefContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function toHaveHrefContainingFn(el: WebdriverIO.Element, href: string, options:
}

export function toHaveHrefContaining(...args: any): any {
return runExpect.call(this, toHaveHrefContainingFn, args)
return runExpect.call(this || {}, toHaveHrefContainingFn, args)
}

export const toHaveLinkContaining = toHaveHrefContaining
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export function toHaveIdFn(el: WebdriverIO.Element, id: string, options: ExpectW
}

export function toHaveId(...args: any): any {
return runExpect.call(this, toHaveIdFn, args)
return runExpect.call(this || {}, toHaveIdFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ export function toHaveStyleFn(received: WebdriverIO.Element | WebdriverIO.Elemen
}

export function toHaveStyle(...args: any): any {
return runExpect.call(this, toHaveStyleFn, args)
return runExpect.call(this || {}, toHaveStyleFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ export function toHaveTextFn(received: WebdriverIO.Element | WebdriverIO.Element
}

export function toHaveText(...args: any): any {
return runExpect.call(this, toHaveTextFn, args)
return runExpect.call(this || {}, toHaveTextFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveTextContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function toHaveTextContainingFn(el: WebdriverIO.Element, text: string | Array<st
}

export function toHaveTextContaining(...args: any): any {
return runExpect.call(this, toHaveTextContainingFn, args)
return runExpect.call(this || {}, toHaveTextContainingFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export function toHaveValueFn(el: WebdriverIO.Element, value: string, options: E
}

export function toHaveValue(...args: any): any {
return runExpect.call(this, toHaveValueFn, args)
return runExpect.call(this || {}, toHaveValueFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/element/toHaveValueContaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function toHaveValueContainingFn(el: WebdriverIO.Element, value: string, options
}

export function toHaveValueContaining(...args: any): any {
return runExpect.call(this, toHaveValueContainingFn, args)
return runExpect.call(this || {}, toHaveValueContainingFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/elements/toBeElementsArrayOfSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ function toBeElementsArrayOfSizeFn(received: WebdriverIO.ElementArray, expected:
}

export function toBeElementsArrayOfSize(...args: any): any {
return runExpect.call(this, toBeElementsArrayOfSizeFn, args)
return runExpect.call(this || {}, toBeElementsArrayOfSizeFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/mock/toBeRequested.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ function toBeRequestedFn(received: Mock, options: ExpectWebdriverIO.CommandOptio
}

export function toBeRequested(...args: any): any {
return runExpect.call(this, toBeRequestedFn, args)
return runExpect.call(this || {}, toBeRequestedFn, args)
}

4 changes: 2 additions & 2 deletions src/matchers/mock/toBeRequestedTimes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { numberError } from '../../util/formatMessage'
export function toBeRequestedTimesFn(received: Mock, expected: number| ExpectWebdriverIO.NumberOptions = {}, options: ExpectWebdriverIO.StringOptions = {}): any {
const isNot = this.isNot || false
const { expectation = `called${typeof expected === 'number' ? ' ' + expected : '' } time${expected !== 1 ? 's' : ''}`, verb = 'be' } = this

// type check
let numberOptions: ExpectWebdriverIO.NumberOptions;
if (typeof expected === 'number') {
Expand Down Expand Up @@ -35,6 +35,6 @@ export function toBeRequestedTimesFn(received: Mock, expected: number| ExpectWeb
}

export function toBeRequestedTimes(...args: any): any {
return runExpect.call(this, toBeRequestedTimesFn, args)
return runExpect.call(this || {}, toBeRequestedTimesFn, args)
}

2 changes: 1 addition & 1 deletion src/matchers/mock/toBeRequestedWith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,5 @@ const deleteUndefinedValues = (obj: Record<string, any>, baseline = obj) => {
}

export function toBeRequestedWith(...args: any): any {
return runExpect.call(this, toBeRequestedWithFn, args)
return runExpect.call(this || {}, toBeRequestedWithFn, args)
}
2 changes: 1 addition & 1 deletion src/matchers/mock/toBeRequestedWithResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ function toBeRequestedWithResponseFn(

export function toBeRequestedWithResponse(...args: any): any {
console.warn('expect(...).toBeRequestedWithResponse is deprecated and will be removed in next release. Use toBeRequestedWith instead.')
return runExpect.call(this, toBeRequestedWithResponseFn, args)
return runExpect.call(this || {}, toBeRequestedWithResponseFn, args)
}

0 comments on commit 2c8efef

Please sign in to comment.