Testing DB in multiple test suites results in exception
See original GitHub issueEach test suite with db-related tests executed separately runs fine. But when I run them all the first one runs fine and every another throws this exception:
TypeError: Cannot redefine property: join
at Function.defineProperties (native)
at Object.<anonymous> (node_modules/realm/lib/index.js:41:8)
My package.json
"jest": {
"preset": "jest-react-native",
"moduleNameMapper": {
"\\./datepicker$": "<rootDir>/node_modules/tcomb-form-native/lib/templates/bootstrap/datepicker.ios.js"
},
"preprocessorIgnorePatterns": [
"node_modules/(?!react-native|tcomb-form-native|apsl-react-native-button)"
],
"testRegex": "(/__tests__/.*|\\.(test))\\.js$",
"collectCoverage": true,
"verbose": true
},
...
"jest": "15.1.1",
"jest-cli": "15.1.1",
"jest-react-native": "15.0.0",
"realm": "git+https://git@github.com/realm/realm-js.git",
As a workaround I might alias npm test
script to run files with db tests separately, but as I described in #521 Jest hangs after finishing any db tests 😦
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Handle exceptions with tests and test suites - OpenClassrooms
For cases where different kinds of exceptions may occur in your program, you can set multiple test cases from multiple classes. As mentioned ......
Read more >SQL Unit Testing: Working with exceptions
In this SQL unit testing article, we will go through how to test the behavior of the exceptions in the SQL unit tests....
Read more >Dynamically generating rackunit test-suite: tests pass and also ...
I am trying to dynamically generate a bunch of test cases. Basically I want to run the same tests several times with different...
Read more >Java Unit Testing with JUnit and TestNG
To test if the code throws a desired exception, use annotation @Test(expected = exception.class) , as illustrated in the previous example. 3.5 JUnit...
Read more >Build with Confidence: A Guide to JUnit Tests - Toptal
For doing regression testing, there are many tests that should be carried out ... then our motive should be to check whether the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this yesterday and have a fix in the works but need to make sure it doesn’t break anything else.
@alazier I hope this is an acceptable place to leave this feedback, but I imagine this is a pretty huge issue for people and I wonder why the fix hasn’t been released yet as a new minor version.
In my understanding, this means one can’t really run tests with the default react native setup when there is a fix for two months already. I feel bad to complain, but I feel like this would cause a lot of react native developers to give up on Realm before they really get started with it.