Open esponges opened 1 month ago
Hi,
We're using this tool in an internal SDK using React and I was wondering if there's a way to unit test the on event? I was checking the src code and you use the getWindows method helper but I'm not very sure if using a similar approach would work.
on
getWindows
// App.tsx useEffect(() => { const onEvent = on('test', (event) => { console.log('do something', event); return Promise.resolve(event); }); return () => onEvent.cancel(); }, []); // App.spec.tsx describe('App', () => { it('test post-robot', async() => { const {container} = render(<App />); // this doesn't work — probably pass window from `getWindows` helper? send(window, 'test', { name: 'test', }); // probably assert using spying post-robot calls }) });
Hi,
We're using this tool in an internal SDK using React and I was wondering if there's a way to unit test the
on
event? I was checking the src code and you use thegetWindows
method helper but I'm not very sure if using a similar approach would work.