Open sinedied opened 7 years ago
Thanks for noting this.
Can you pin your types in the meantime to resolve this?
Sure, it's already done 😉 Thanks for this great tool anyways!
yep :-(
I also observed this
e2e/app.e2e-spec.ts(23,54): error TS2345: Argument of type 'false' is not assignable to parameter of type 'Expected<Promise<boolean>>'.
for the line
expect(element(by.css('h1')).isPresent()).toBe(false);
Downgraded jasmine typings to
"@types/jasmine": "2.5.45"
For Jasmine tests you can use @types/jasminewd2
additionally to @types/jasmine
.
expect(
to
expect
its worked for me
@ChristianStornowski still not working even with @types/jasminewd2
Here are my settings for package.json
... "devDependencies": { ... "@types/jasmine": "^2.5.52", "@types/jasminewd2": "^2.0.2", "jasmine-core": "^2.6.4", "typescript": "^2.3.4", ... } ...
for tsconfig.json
{ "compilerOptions": { "target": "es5", "module": "CommonJS", "moduleResolution": "Node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "outDir": "build", "strictNullChecks": true, "lib": [ "DOM", "ES5", "ES6", "ES7", "DOM.Iterable", "ScriptHost" ] } }
This is working with current IntellIJ for me.
@ChristianStornowski Thanks, I found why it wasn't working!
I'm using angular-cli
and the default e2e package.json
config has:
"types": [
"jasmine",
"node"
]
changing it to:
"types": [
"jasmine",
"jasminewd2",
"node"
]
make it work!
Any updates after 13 months guys ?
@mruzek What kind of update do you expect? There is nothing broken here.
You have two options:
@types/jasminewd2
as pointed out above and keep using Protractor with SELENIUM_PROMISE_MANAGER: true
(not recommended solution, because it is deprecated, has pile of drawbacks and will be removed eventually).SELENIUM_PROMISE_MANAGER: false
and use async/await
syntax instead (recommended solution, see docs here).
Since the release of
@types/jasmine@2.5.46
I have this issue while running my protractor tests with typescript:This trace back to this code:
In the new jasmine types, the
expect
typings are now enforced (it wasn't the case before). It seems that the protractor jasmine overrides that wait for Promises to resolve before performing the match needs to extends the typings for this to work correctly.Bug report
6.x
5.x
2.x
PhantomJS
osx 10.12.11