Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

112
Views
¿Cómo puedo burlarme del argumento del evento en karma chai sinon mocha?

¿Cómo puedo burlarme del argumento del evento en karma chai sinon mocha?

 it('should have onmute event on tracks', async () => { if (fakeAudioTracks[0].onmute !== null) { console.log('before fakeAudioTracks[0] ', fakeAudioTracks[0]); eventCallbackSpy = Sinon.spy(); subscriptions.events['track:mute'].set(subscription.listener.id, eventCallbackSpy); fakeAudioTracks[0].enabled = true; fakeAudioTracks[0].onmute(new Event('mute')); Sinon.assert.called(eventCallbackSpy); // expect(eventCallbackSpy.getCall(0).args[0].action).to.be.equal('muted'); console.log('After fakeAudioTracks[0] ', fakeAudioTracks[0]); expect(eventCallbackSpy.getCall(0).args[0].action).to.be.equal('muted'); } });

Este es mi caso de prueba, quiero pasar un argumento fakeAudioTracks[0] a fakeAudioTracks[0].onmute(new Event('mute')); este.

Mi onmute -

 export function onmute(event: Event) : void { console.log('event ', event.target); const onmuteListeners: eventListeners = subscriptions.events['track:mute']; for (const entry of onmuteListeners) { const listener = entry[1]; if (listener) { listener({ action: 'muted' || 'unmuted', // need to check the event.target and return this. // action: event.target.enabled === 'true' ? 'muted' : 'unmuted', track: <MediaStreamTrack> event.target, }); } } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!