@roomservice/browser
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40178
590