These are chat archives for highfidelity/hifi

29th
Nov 2016
Ryan Huffman
@huffman
Nov 29 2016 00:00
Sorry, no, at the top of the update function
And two
Change your connect line to read Script.update.connect(this, this.update)
That will set the this value when this.update is called
Polyrhythm
@Polyrhythm
Nov 29 2016 00:01
ah ok, or i could use the bind PR i made :)
Ryan Huffman
@huffman
Nov 29 2016 00:02
yeah you could do that too ;)
Polyrhythm
@Polyrhythm
Nov 29 2016 00:02
it seems that the update connection persists after the entity is destroyed too
like i get logs constantly updating themselves due to my update loop long after the entity goes away
Ryan Huffman
@huffman
Nov 29 2016 00:02
Yeah, that's a known issue, you will need to manually disconnect in unload
Script.update.disconnect(this.update);
Polyrhythm
@Polyrhythm
Nov 29 2016 00:03
sweet, thanks very much for helping me out a bit
Ryan Huffman
@huffman
Nov 29 2016 00:03
Yeah, np, let me know if you need more help
thanks for the PR ;)
Polyrhythm
@Polyrhythm
Nov 29 2016 00:04
yeah trying to get a unit test to support it as well, not sure what your internal standards are but i like having tests for every PR if possiible
Ryan Huffman
@huffman
Nov 29 2016 00:06
We don't have any internal requirements currently. Support for unit tests is somewhat spotty - it exists, but mostly on an ad-hoc basis, particularly on the JS side
Polyrhythm
@Polyrhythm
Nov 29 2016 00:06
is there a central file that includes/run/automates them?
Ryan Huffman
@huffman
Nov 29 2016 00:09
For C++ the generated project will have test targets. For JS, no
Open to suggestions if you have a good idea for that. I'm not sure if that in particular would get funded, but we do pay for projects at https://worklist.net/
Polyrhythm
@Polyrhythm
Nov 29 2016 00:19
yeah i'm pretty experienced with JS tooling, i have some ideas...
i also like really simple stuff so it might be as simple as a bash script that can be run
Ryan Huffman
@huffman
Nov 29 2016 00:27
Would it run within the context of the hifi client?
Polyrhythm
@Polyrhythm
Nov 29 2016 00:28
that's something i hadn't considered, but ideally unit tests would run in a headless env and only integration tests would use a full client
which would allow for a more BDD/TDD way of testing if the test execution is fast and headless
Polyrhythm
@Polyrhythm
Nov 29 2016 01:27
looks like there's a scripts/developer/libraries/utils.js used for tests and a scripts/system/libraries/utils.js used by actual code
i recommend all tests use the canonical one and not have to maintain two separate files that do the same thing unless there's a good reason for it
Ryan Huffman
@huffman
Nov 29 2016 16:35
Yeah, that's sensible - I'm not sure why there are two of what is mostly the same file.