After completing the project setup, the wdio.conf.ts
and tsconfig.json
files are saved in a folder named tests. However, the wdio.conf.ts
file throws an error on this line:
import type { Options } from "@wdio/types"; //located in wdio.conf.ts
The error message reads:
> Cannot find module '@wdio/types'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option
This is the default content of my wdio.conf.ts
file:
import type { Options } from "@wdio/types";
export const config: Options.Testrunner = {
//
// ====================
// Runner Configuration
// ====================
//
...
};
And here is the content of my tsconfig.json
file:
{
"compilerOptions": {
"types": [
"node",
"webdriverio/async",
"@wdio/cucumber-framework",
"expect-webdriverio"
],
"target": "es2019"
}
}