Get help with testing, discuss unit testing strategies etc.


Post by jminutella »

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
bin/nodejs path/to/examples/nodejs/unit-tests/basic_assertions.t.js
I get a
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.26 KiB) Viewed 3965 times

Post by nickolay »

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.78 KiB) Viewed 3961 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)

Post by nickolay »

What if you `cd` to the Siesta folder and run `bin/nodejs examples/nodejs..../basic_assertions.t.js` from there?

Post by nickolay »

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 (140.76 KiB) Viewed 3958 times

Post by nickolay »

Fixed now. Please verify in the tomorrow nightly. 5.2.3 planned for tomorrow.
Attachments
screenshot3.jpg
screenshot3.jpg (80.6 KiB) Viewed 3958 times

Post by jminutella »

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 (40.93 KiB) Viewed 3949 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.5 KiB) Viewed 3949 times

Post by jminutella »

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

Post by nickolay »

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.

Post by jminutella »

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.63 KiB) Viewed 3946 times

Post by jminutella »

Hey guys, any update on this?

Post Reply