Just writing import { expect } from 'expect-webdriverio' will load jest-global.d.ts due to this exports specifier, which makes expect symbol available in the global scope in type-level.
However, when using it in a standalone script, there is no expect in runtime so this causes a mismatch between runtime and types.
Note that this is the case as of v4.11.9 (3fdc1bd)