Skip to content

Commit

Permalink
PR updates
Browse files Browse the repository at this point in the history
  • Loading branch information
takameyer committed Apr 29, 2022
1 parent ef4b722 commit ea7dc6f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/js_user.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ class User : public SharedUser {
, m_app(nullptr)
{
}
User(User&&) = default;

// Remove copy constructors to avoid destroying the listener Token
User(const User&) = delete;
User& operator=(const User&) = delete;

User(User&&) = default;
User& operator=(User&&) = default;
// User& operator=(User const&) = default;

using CallbackTokenPair = std::pair<Protected<typename T::Function>, Token>;
std::forward_list<CallbackTokenPair> m_notification_tokens;
Expand Down
Binary file removed tests/.lock
Binary file not shown.
6 changes: 5 additions & 1 deletion tests/js/app-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,22 @@ module.exports = {

const listenerEvent = () => {
eventListenerCalls += 1;
console.log("calls thus far: ", eventListenerCalls);
};

app.addListener(listenerEvent);

let credentials = Realm.Credentials.anonymous();
let user = await app.logIn(credentials);
TestCase.assertEqual(eventListenerCalls, 1);

await user.logOut();
TestCase.assertEqual(eventListenerCalls, 2);
credentials = Realm.Credentials.anonymous();

user = await app.logIn(credentials);
TestCase.assertEqual(eventListenerCalls, 3);

// Remove the listener and verify that the event listener was not fired
app.removeListener(listenerEvent);
await user.logOut();
TestCase.assertEqual(eventListenerCalls, 3);
Expand Down
2 changes: 0 additions & 2 deletions tests/realm-bundle.realm.backup-log

This file was deleted.

2 changes: 1 addition & 1 deletion tests/spec/unit_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RealmLogging.patch(Realm);

const RealmTests = require("../js");

jasmine.DEFAULT_TIMEOUT_INTERVAL = 300000000;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
let isDebuggerAttached = typeof v8debug === "object";
if (!isDebuggerAttached && isNodeProcess) {
isDebuggerAttached = /--debug|--inspect/.test(process.execArgv.join(" "));
Expand Down

0 comments on commit ea7dc6f

Please sign in to comment.