Serenity-js: Support for serenity-js with typescript 2.4.2 version

Created on 31 Jan 2018  Â·  4Comments  Â·  Source: serenity-js/serenity-js

Currently, I'm using in serenity-js in a project and we had to upgrade the angular version to 5.2.0, but after that, it has some issues with the typescript version when I run the e2e test.

This is an example of the error that I get using typescript 2.4.2 and running the e2e test.

info: Serenity BDD CLI jar file is up to date :-)
WARNING: NODE_ENV value of 'test' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
(node:8344) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[13:56:28] I/launcher - Running 1 instances of WebDriver
[13:56:28] I/local - Starting selenium standalone server...
[13:56:29] I/local - Selenium standalone server started at http://10.236.216.61:64896/wd/hub
***Getting_Resolution***
 BROWSER SIZE {"height":807,"width":1051}
***The_Resolution_is:desktop***
⨯ Unable to compile TypeScript
Cannot find type definition file for 'chai'. (2688)
Cannot find type definition file for 'chai-as-promised'. (2688)
Cannot find type definition file for 'core-js'. (2688)
Cannot find type definition file for 'cucumber'. (2688)
Cannot find type definition file for 'grecaptcha'. (2688)
Cannot find type definition file for 'hammerjs'. (2688)
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'jasminewd2'. (2688)
Cannot find type definition file for 'node'. (2688)
Cannot find type definition file for 'promises-a-plus'. (2688)
Cannot find type definition file for 'q'. (2688)
Cannot find type definition file for 'selenium-webdriver'. (2688)
e2e\features\support\world.ts (1,26): Cannot find module 'serenity-js'. (2307)
e2e\features\support\world.ts (2,24): Cannot find module '../../screenplay/actors'. (2307)
[13:56:34] I/local - Shutting down selenium standalone server.
[13:56:34] I/launcher - 0 instance(s) of WebDriver still running
[13:56:34] I/launcher - chrome #01 failed 1 test(s)
[13:56:34] I/launcher - overall: 1 failed spec(s)

After reviewing the issue with the versions, I've decided to update in my project the typescript version to 2.4.0 and finally, the e2e tests are running, however, I'm getting a warning message when I build the project using angular-cli.

@angular/[email protected] requires typescript@'>=2.4.2 <2.5.0' but 2.4.0 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

    npm install typescript@'>=2.4.2 <2.5.0'

To disable this warning run "ng set warnings.typescriptMismatch=false".

Is possible for this project, add compatibility to support at least the typescript 2.4.2 version in order to avoid the warning with angular 5 projects?

Thanks in advance,

Edwin Torres.

Most helpful comment

Thanks @jan-molak I'll be waiting for that.

Cheers and happy coding.
Edwin.

All 4 comments

Thanks for reporting that, Edwin! The newer versions of TypeScript are a bit more strict on generics. SerenityBDDReporter needs to be improved so support those new rules. I'm planning to work on this shortly.

Thanks,
Jan

Thanks @jan-molak I'll be waiting for that.

Cheers and happy coding.
Edwin.

Is there any progress on this issue? I am having the same issue.

Thanks.

@azimmalik - Serenity/JS v2 is transpiled using TypeScript 3.6. Since version 2 is going to supersede v1, the best way forward will be to upgrade to v2.

There's an example project available at https://github.com/serenity-js/serenity-js-cucumber-protractor-template and I'm working on documentation and an "official" release of v2 (currently in stable alpha) as we speak.

Hope this helps!
Jan

Was this page helpful?
0 / 5 - 0 ratings