customize mm2 run karma start karma.config.js get error

customize mm2 run karma start karma.config.js get error

by Allen Chen -
Number of replies: 1

Hi everyone,


i clone the mm2 source code

no changes the source code

ionic build android is success...

but i run 

karma start karma.config.js 

get error

「Type Error: Cannot red property ''setSite' of underfined」

how do I solve this problem?


Thanks in advance for taking the time to help!

Attachment karma.png
Average of ratings: -
In reply to Allen Chen

Re: customize mm2 run karma start karma.config.js get error

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Allen,

we found a lot of problems with unit testing and asynchronous functions. We implemented a whole bunch of tests and they worked fine for me, but they failed for other colleagues due to timeouts and stuff like that. So in the end we didn't integrate them, so the tests that are in there are really old and not maintained, I guess that's why they fail.

So we decided to move to end to end testing. We're still starting with this, we plan to keep adding more tests in the future and to have a set of Moodle sites that can be resetted after the tests, since right now some tests will fail if you run them twice because the data is still stored.

Here are some issues about this:

https://tracker.moodle.org/browse/MOBILE-1179

https://tracker.moodle.org/browse/MOBILE-1682

Kind regards,

Dani

Average of ratings: Useful (1)