-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"eventually not a property of Assertion" error #30
Comments
Thanks for reporting this, that's interesting. Are you seeing this problem on a fresh copy of |
Actually I'm also experiencing the same error when I'm creating my scripts using Screenplay pattern. I just follow what is instructed on the tutorial but that TSError (2339) always appearing. |
Sorry to hear that, what platform are you on? OS/node version? Also, @johnlister and @marktigno would you be able to push a code sample to github so that I can try to reproduce the problem? I think this might be caused by the |
@jan-molak Here's what I used on my machine: I used npm manager to pull a fresh copy of the packages, but the problem is on the chai-as-promise part where it says the "eventually" is not recognized as part of 'Assertion'. I check the exports from the 'expect.ts' file on the sample project to see if the references are properly set, but it seems there is something missing on it. |
Windows 10, fresh install of Node 6.10, updated to latest NPM (4.4). clone the tutorial and switch to "2-reports" branch I haven't installed any npm modules globally - oddly visual studio code doesn't complain about eventually, but does note that expect returns the base Assertion class and not a PromiseAssertion. I'm reasonably new to typescript, but is this a types issue in how it interprets the response of expect? |
I see what you mean, but I'm not able to reproduce the issue on a MacOS and don't have access to a Windows machine at the moment. There are several things at play here, so maybe this will help you find out more about the root cause of the problem:
For
My IntelliJ is configured to use the local TypeScript module and the I'm guessing that VS might need similar sort of configuration. Perhaps VS has a setting to enable TypeScript language service? |
Visual Studio Code seems to work fine, it seems to be the just in time compilation when it loads the web page or test within? I only used VS code to load the project just to see if it gave me any clues. The error happens when I run "npm test". One other thing, I can see in the transpiled javascript the files from screenplay, but not in features? |
I found the solution here: |
Perfect, works for me. Oddly google didn't bring that up, but I did spot something similar in another project. I incorrectly assumed that both forms were identical in function - clearly not. |
Hey @johnlister @marktigno, I've just updated the tutorial, would you mind checking if that helps to solve the problem you noticed? |
@jan-molak will do, I'll apply the latest updates on my local machine and verify the fix. |
Hello @jan-molak, I've verified the fix and now it's working. However there's a separate issue when running the test. It seems it's getting a timeout issue after it's launch. But I've made another fix on it so it won't happened again. Thanks! :) |
No problem at all! The todomvc.com website can be slow at times, so setting the timeout will definitely help :-) |
Hi, the fix you've put in place works, but there is an issue on the dependency of gherkin. It now fetches v4.1.1 of gherkin (via cucumber) which when I run it causes the following issue:
Forcing gherkin to be v4.0.0 works - it looks like the only difference is gherkin has updated to using node 7 - I suspect the path api has changed as I'm currently running node 6.10 |
Thanks @johnlister, @metrophos has just raised that under #32 |
…rrectly on Windows affects: serenity-js ISSUES CLOSED: #30
Hello @jan-molak! |
Perfect, thanks for the update :-) |
I am trying to use Chai Promise test but it show an error Here a simple function
simple test
Error on terminal
|
Hi @rollrodrig, At first glance, the reason behind the compiler error seems to be the mixup of different import styles. Instead of saying: import chai from 'chai';
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
let expect = chai.expect;
let assert = chai.assert; Try: import chai = require('chai');
import chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
const expect = chai.expect; The Hope this helps! |
Thanks !! |
Cool, glad we could help 👍 |
While trying to run the tests (using the 2-reports branch). I get the following error:
[14:27:57] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
features\step_definitions\todo_user.steps.ts (31,14): Property 'eventually' does not exist on type 'Assertion'. (2339)
at getOutput (C:\src\js\tutorial-from-scripts-to-serenity\node_modules\ts-node\src\index.ts:312:17)
at C:\src\js\tutorial-from-scripts-to-serenity\node_modules\ts-node\src\index.ts:343:18
at Object.compile (C:\src\js\tutorial-from-scripts-to-serenity\node_modules\ts-node\src\index.ts:476:19)
at Module.m._compile (C:\src\js\tutorial-from-scripts-to-serenity\node_modules\ts-node\src\index.ts:406:44)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\src\js\tutorial-from-scripts-to-serenity\node_modules\ts-node\src\index.ts:409:12)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
It appears that either "chai as promises" isn't being setup properly or there is a typescript issue.
using node 6.10 and npm 4.4.1.
Am I missing something obvious?
The text was updated successfully, but these errors were encountered: