Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing dev environment and examples to run #1075

Closed
wants to merge 2 commits into from

Conversation

ProPablo
Copy link

I would like to create a consistent environment to test some of the features of this library with actual browser API exposed. The tests that are currently made using jest (and the old ones using chai) failed due to timeout because createOffer is not being a valid function on the mocked RTCPeerConnection object.

image (1)
It may be a better approach to simply host an environment that runs in the browser and test its endpoints or validate objects using a browser based testing framework.

So far its just a scaffold of what this environment might look like but I wish to recreate a similar version of what exists in
https://github.com/webrtc/samples.

I may start with a sample for Dataconnection in a similar vein as https://webrtc.github.io/samples/src/content/datachannel/filetransfer/ as that is what I'm primarily looking to use (see #1074).

I can understand stripping away vite for this and going for a barebones vanilla environment but I just saw it as the most convenient way to do module imports locally as well as support any other imports that might need to happen.

Also, just chose vanilla as that would simply be the most agnostic but I'm open to relying on any framework of choice.

Any feedback would be appreciated and taken into consideration :)

@jonasgloning
Copy link
Member

Hey @ProPablo, thanks for working on this!

It may be a better approach to simply host an environment that runs in the browser and test its endpoints or validate objects using a browser based testing framework.

I agree! Lots of WebRTC stuff is subtly different between browsers, and the Node environment we are currently testing in is a lousy substitute for now. Testing in browsers would also help ensure compatibility with all supported older browsers.

BrowserStack gave us a sponsored account to automate testing with real browsers. They support among others Cypress and Playwright. If one of those frameworks is an option for you, I would go with one of them.

I have a preference for Parcel over Vite (because all repositories in this org use it) but that's a small detail that could be changed later.

We need a proper testsuite for this project. If there is anything we can do to help, just ask (ping @peers/maintainers). We can also give you access to BrowserStack and some VMs for development if needed.

@jonasgloning
Copy link
Member

I just merged #1094, a test suite in real browsers, so we won't need this scaffold going forward.
Feel free to add test cases that match what you are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants