question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest Tests on Linux machine failing becasue of Realm.Sync

See original GitHub issue

Hi I am having issues with Realm on my Linux machine when I try to run jest unit tests. All the tests fail with

● Test suite failed to run

    Realm.Sync is not available. Note that the developer edition of the Node.JS SDK for Realm does not include sync on Linux.
      
      at Function.get (node_modules/realm/lib/extensions.js:72:7)
      at Object.<anonymous>.module.exports (node_modules/realm/lib/extensions.js:44:20)
      at Object.<anonymous> (node_modules/realm/lib/index.js:95:24)
      at Object.<anonymous> (src/realm/index.js:1:585)

I saw that the “problem” was introduced on the PR https://github.com/realm/realm-js/pull/925 referenced on the issue https://github.com/realm/realm-js/issues/923 The problem is that I am not using Sync at all. Should not this being thrown just in case of actual usage? Thanks a lot

Goals

Being able to run my unit-tests for a react-native project using realmjs on a machine running Linux

Expected results

The CI process to match what we have on the dev machine (all the tests passed)

Actual results

all the tests fail with this error

● Test suite failed to run

    Realm.Sync is not available. Note that the developer edition of the Node.JS SDK for Realm does not include sync on Linux.
      
      at Function.get (node_modules/realm/lib/extensions.js:72:7)
      at Object.<anonymous>.module.exports (node_modules/realm/lib/extensions.js:44:20)
      at Object.<anonymous> (node_modules/realm/lib/index.js:95:24)
      at Object.<anonymous> (src/realm/index.js:1:585)

Steps to reproduce

  1. Get a Linux machine
  2. Make a react-native project including react and jest
  3. Use realm somewhere in your code base
  4. Run a test

Code sample that highlights the issue (full Xcode / Android Studio projects that we can compile ourselves are ideal)

No test code is using realm, just one single file

const realm = new Realm({path: 'app.realm', schema: [Some, Schema, Around, App]});

Version of Realm/Linux

from packages.json

"react": "16.0.0-alpha.6",
"react-native": "0.43.4",
"realm": "^1.2.0"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
blagoevcommented, Jun 20, 2017

there will be very soon

0reactions
vikkio88commented, Jun 20, 2017

oh thank you very much for this change, I completely forgot that I had opened this issue. Is there a new version released of the npm package yet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reroute realm network for jest test locally, error when call ...
First I reroute the routine that opening the realm connection so that when the code runs in the jest-test environment it will open...
Read more >
babel-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Node.js v19.3.0 Documentation
Indicates the failure of an assertion. All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError( ...
Read more >
realm - npm Package Health Analysis
You can connect your project's repository to Snyk to stay up to date on security alerts and receive automatic fix pull requests. #...
Read more >
Npm install command failing with message "could not find ...
And the node_modules folder is not created. My computer setup: Windows 10 - Version 21H1 build 19043.1165 NodeJS / NPM - v16.6.1 /...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found