Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@roomservice/browser

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@roomservice/browser - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

2

dist/client.js

@@ -79,3 +79,2 @@ "use strict";

});
this._automergeConn.open(); // must be called immediately after socket def
/**

@@ -116,2 +115,3 @@ * Errors

}
this._automergeConn.open();
return {

@@ -118,0 +118,0 @@ state,

@@ -129,3 +129,29 @@ "use strict";

});
test("will update net with off-synced doc after coming online", async () => {
const client = new client_1.default(URL + "/api/roomservice");
const room = client.room("my-room");
// Offline
jest.spyOn(offline_1.default, "get").mockImplementation(async (ref, doc) => {
return automerge_1.save(automerge_1.from({ offline: "offline" }));
});
// Current online
mockAuthEndpoint(automerge_1.save(automerge_1.from({ current: "current" })));
// Attempt to publish an update while offline
room.publishState(state => {
state.update = "update";
});
const emit = jest.fn();
jest
.spyOn(socket_1.default, "newSocket")
// @ts-ignore because typescript doesn't like our deep testing magic
.mockImplementation((url, connectopts) => {
return {
emit,
on: jest.fn()
};
});
await room.connect();
console.log(emit.mock.calls);
});
});
//# sourceMappingURL=client.test.js.map
{
"name": "@roomservice/browser",
"version": "0.0.14",
"version": "0.0.15",
"main": "dist/index",

@@ -5,0 +5,0 @@ "types": "dist/index",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc