Testing a Jutsu App
BlaidddDrwg opened this issue · 3 comments
I am trying to write a simple test for Jutsu, but I keep running into an error that says:
TypeError: jitsi.executeCommand is not a function
This happens where we try:
render(<App />)
I do have an Error Boundary around this, so the error is isolated from the rest of the code, but it would be good to be able to test this in some way.
Any idea how to solve this ? I am not understanding this very well...
Hey @BlaidddDrwg , I am not all sure on how you are testing this, but my guess right now would be that your test runtime does not have the jitsi api included in it since that is added as a script tag in the body on the react app index.html
<body>
<script src='https://meet.jit.si/external_api.js'></script>
</body>
not sure what your goal is with testing, but you could try using a mock library to mock the jitsi api and provide that to your test runtime so when it runs the jitsi.executeCommand
it uses your mock definition of that function
That totally makes sense ! It would not test Jutsu or Jitsi, but it could be used to run other tests on an App that uses video calling as a component, which could be useful for some.
Thanks for this, @this-fifo
Glad I could help! :)