-
Notifications
You must be signed in to change notification settings - Fork 97
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
add browser tck test suite #212
base: 1.0.x
Are you sure you want to change the base?
Conversation
6a1cc17
to
8a14afb
Compare
Signed-off-by: Kevin Viglucci <[email protected]>
…t/mocha type conflicts Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
…er incompatibility Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
Signed-off-by: Kevin Viglucci <[email protected]>
f073dd3
to
836c0b3
Compare
@@ -14,6 +14,7 @@ | |||
"test": "yarn jest" | |||
}, | |||
"devDependencies": { | |||
"@types/jest": "^27.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jest
and mocha
have conflicting type definitions that cause issues when compiling with karma-typescript
, which we can overcome by moving the @types/jest
into the dependencies list of the individual packages, and telling yarn workspaces not to house the types as well so that they are not discovered by typescript when compiling in the new browser-tck
package.
This would be less of an issue if we used jest
in the browser-tck as well, but there is complications getting Jest to run in a browser, such as needing to provide a bunch of pollyfills, so using mocha was a bit simpler there.
Signed-off-by: Kevin Viglucci <[email protected]>
I expect that for browser env folks will be importing any buffer polyfill. Thus, should we add from the browser test dependency? |
My hope has been that we can support supplying a polyfill through the public API, via optional constructor dependency injection, or other DI pattern (like how we support WebSocket factory on the WS client transport). Most front-end build tools support polyfilling an API globally, but it varies by tool, and is often confusing for new users. So my goal would be to offer browser support directly, rather than require global polyfill. |
Adds a test suite that exercises various
@rsocket
packages and patterns to ensure compatibility with Browser environments. This is done by compiling the actual test files into a browser-compatible version, and executing the test suite from within a browser context using Karma.The suite is intended to run on all pushes and PR's, though you'll notice there are browser compatibility issues with various RSocket APIs, so the suite currently fails. In addition to the initial tests added in this PR, there are likely other APIs with browser compatibility issues (really anywhere Buffer is used) that will need to ultimately be covered as well.
Example test output: