Can't run NodeJs examples

Get help with testing, discuss unit testing strategies etc.
Post Reply
User avatar
jminutella
Posts: 45
Joined: Wed Oct 19, 2016 3:03 pm

Can't run NodeJs examples

Post by jminutella » Wed May 15, 2019 8:32 pm

Hi again,

I'm following the guide (https://www.bryntum.com/docs/siesta/#!/ ... ted_nodejs) and exploring running our tests with NodeJs. We have Siesta 5.2.2 standard and when I run

Code: Select all

bin/nodejs path/to/examples/nodejs/unit-tests/basic_assertions.t.js
I get a

Code: Select all

TypeError: Cannot read property 'Project' of undefined
See the image below.

Hopefully, I'm not missing something so obvious. Thanks!
Attachments
nodejs_error.PNG
nodejs_error.PNG (35.36 KiB) Viewed 341 times

User avatar
nickolay
Core Developer
Core Developer
Posts: 3337
Joined: Mon May 16, 2011 10:48 am

Re: Can't run NodeJs examples

Post by nickolay » Wed May 15, 2019 9:23 pm

Hi,

Hm.. Thanks for the report, this definitely works for me, using Node 8.16.0 and on Linux though.
screenshot1.jpg
screenshot1.jpg (37.88 KiB) Viewed 337 times
I'll check with Node 11 and on Windows tomorrow.

What if you launch the project file directly? (`node examples/nodejs/siesta.js`, where the `node` is the Node.js binary, not the "bin/nodejs" launcher)
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
nickolay
Core Developer
Core Developer
Posts: 3337
Joined: Mon May 16, 2011 10:48 am

Re: Can't run NodeJs examples

Post by nickolay » Wed May 15, 2019 9:52 pm

What if you `cd` to the Siesta folder and run `bin/nodejs examples/nodejs..../basic_assertions.t.js` from there?
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
nickolay
Core Developer
Core Developer
Posts: 3337
Joined: Mon May 16, 2011 10:48 am

Re: Can't run NodeJs examples

Post by nickolay » Thu May 16, 2019 9:39 am

Confirmed to be Node version related. Regression happened somewhere after the Node 10.5 (see screenshot). Thanks for the report, we'll fix this very soon.
Attachments
screenshot2.jpg
screenshot2.jpg (141.2 KiB) Viewed 334 times
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
nickolay
Core Developer
Core Developer
Posts: 3337
Joined: Mon May 16, 2011 10:48 am

Re: Can't run NodeJs examples

Post by nickolay » Thu May 16, 2019 11:16 am

Fixed now. Please verify in the tomorrow nightly. 5.2.3 planned for tomorrow.
Attachments
screenshot3.jpg
screenshot3.jpg (80.83 KiB) Viewed 334 times
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
jminutella
Posts: 45
Joined: Wed Oct 19, 2016 3:03 pm

Re: Can't run NodeJs examples

Post by jminutella » Fri May 17, 2019 3:22 pm

Hey nickolay,

Thanks so much for the quick response. I was out of the office yesterday so sorry for the delayed response. I just downloaded the nightly you suggested and I get this error:
siesta_node_5-16_nightly.PNG
siesta_node_5-16_nightly.PNG (41.08 KiB) Viewed 325 times
However, it's worth noting that when I downgraded to NodeJS 10.15.3, I get this error:
nodejs_10_15_3_nodejsproject_error.PNG
nodejs_10_15_3_nodejsproject_error.PNG (48.63 KiB) Viewed 325 times

User avatar
jminutella
Posts: 45
Joined: Wed Oct 19, 2016 3:03 pm

Re: Can't run NodeJs examples

Post by jminutella » Fri May 17, 2019 3:25 pm

Do you suggest sticking with the NodeJS LTS version 10.15.3 instead?

User avatar
nickolay
Core Developer
Core Developer
Posts: 3337
Joined: Mon May 16, 2011 10:48 am

Re: Can't run NodeJs examples

Post by nickolay » Fri May 17, 2019 3:36 pm

Hey,

About the `glob` error - it seems the nightly build comes w/o `node_modules` folder - we'll fix soon, in the meantime, try just `npm install` in the nightly folder.

Can you please try running Siesta examples with these 2 commands (from the nightly folder):
- `node examples/nodejs/siesta.js` - this uses "native" node.js binary to launch the siesta project file
- `bin/nodejs examples/nodejs`- this uses node.js launcher + glob pattern to choose the tests to run (the whole directory in this case)

About Node.js version - both should work now, but the LTS had received much better testing. We'll fix any issues with the latest node version promptly, so feel free to use it.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

User avatar
jminutella
Posts: 45
Joined: Wed Oct 19, 2016 3:03 pm

Re: Can't run NodeJs examples

Post by jminutella » Fri May 17, 2019 4:58 pm

Gotcha - I'm still getting the glob error and here's a screenshot with the commands you requested.
Attachments
nodejs_glob.PNG
nodejs_glob.PNG (76.88 KiB) Viewed 322 times

User avatar
jminutella
Posts: 45
Joined: Wed Oct 19, 2016 3:03 pm

Re: Can't run NodeJs examples

Post by jminutella » Mon May 20, 2019 1:43 pm

Hey guys, any update on this?

Post Reply