webdriverio-schematics
webdriverio-schematics copied to clipboard
Typing is not recognized in Vscode
Version: v1.1.1
Issue
Running ng add @wdio/schematics
will add a test/tsconfig.e2e.json
file.
But Vscode
only knowns typescript configuration file named tsconfig.json
.
This results in multiple typing errors :

Solution
Use tsconfig.json
instead of tsconfig.e2e.json
to name the typescript configuration file.
@Badisi what is your experience of having different tsconfig files for app and test files?
For one, angular
is using a tsconfig.json
with "module": "es2020"
whereas for the tests we need a tsconfig.json
with "module": "commonjs"
Ah I remember the issue. Yeah in this case we surely need a separate tsconfig.json.
The schematics already adds a second tsconfig file in /test
, which is great !
But the issue here is that the file is named tsconfig.e2e.json
which Vscode doesn't know about...
Making sure we get a test/tsconfig.json
instead of test/tsconfig.e2e.json
would allow Vscode to find it and properly resolves typing
Making sure we get a
test/tsconfig.json
instead oftest/tsconfig.e2e.json
would allow Vscode to find it and properly resolves typing
Sounds like a reasonable solution to me, mind sending in a PR?
Working on it as we speak but also working on other improvements too ;-)
Thanks so much! Keep them coming ☺️
For this one to work completely we would also have to make sure that the wdio.conf.ts
is located in the /test
folder.
Otherwise Vscode would also complain about typing.
