Commit Graph

36 Commits

Author SHA1 Message Date
Scott Kyle a5ec799a7c Copy whole lib module into JS test bundle
This meant we needed to rename tests/lib to tests/js so they folder names would not conflict.
2016-02-29 03:24:58 -08:00
Scott Kyle 154422a3d1 Make realm instances pass instanceof check 2016-02-29 03:24:58 -08:00
Ari Lazier 4177b0fb40 fix for test naming 2016-02-26 11:18:47 -08:00
Ari Lazier e495cc4685 add encryption support 2016-02-26 11:08:59 -08:00
Tim Anglade 7cc2f69736 Merge pull request #264 from realm/km-js-fixlicense
License update
2016-02-21 18:56:59 -08:00
Scott Kyle 2e3a3b5db8 Merge pull request #257 from realm/sk-schema-prop
The schema property should be directly on constructor
2016-02-18 16:27:47 -08:00
Karson Miller 5e9333b699 no message 2016-02-18 15:30:44 -08:00
Scott Kyle d322d5dd9c Add property test for objects with constructor 2016-02-18 13:50:45 -08:00
Scott Kyle 5332131c14 Add sorted() method to List 2016-02-18 13:41:11 -08:00
Scott Kyle d847fbceb1 Further improve argument checking for sorted() 2016-02-18 12:55:54 -08:00
Scott Kyle 05d84b23a2 Change sortedBy API as discussed
If provided an array, then each member can optionally be an array of [propName, reverse]
2016-02-18 12:47:18 -08:00
Scott Kyle 76865d0da4 Allow sortedBy to accept array of properties
It now optionally accepts an array of properties for both parameters and the tests have been updated to reflect new capabilities.
2016-02-18 11:58:39 -08:00
Scott Kyle 249bcd8f3f Change sortByProperty to return new Results
The method name changed to sortedBy to reflect that it returns a new Results object and to be more succinct. Also, the second optional argument instead reflects descending (or rather, reverse) since it's an anti-pattern to have an optional argument default to true in JS, and this also follows precedences set by other JS libraries and by Python's sorted function.
2016-02-18 11:58:39 -08:00
Scott Kyle b34e52b290 The schema property should be directly on constructor
The constructor is now also called with `this` set as the constructed object.

Fixes #232
2016-02-18 11:10:02 -08:00
Ari Lazier b3486c0d0e final fixes 2016-02-17 20:51:03 -08:00
Ari Lazier 6d02614eaa add List.filtered 2016-02-17 20:24:08 -08:00
Ari Lazier d838d61de4 test query refinement 2016-02-17 20:09:39 -08:00
Ari Lazier e91ef42ebb add filtered method 2016-02-17 20:06:42 -08:00
Scott Kyle 0188517e74 Add test for ListViewDataSource to React Test App 2016-02-15 14:56:44 -08:00
Scott Kyle 1f030a0618 Make several improvements to how tests run under RN
These changes include timeouts when waiting on notifications.
2016-02-15 14:50:16 -08:00
Scott Kyle 337f8d7650 Remove realm dependency in realm-tests
This caused an error with NPM v3 and was not necessary for us to have.
2016-01-15 16:24:53 -08:00
Scott Kyle 2f1eca4a9c Merge branch 'master' into al-android-example
* master:
  Fix typo in README
  Improve clarity of schema parsing and serialization
  Add test that checks schema validation
  Update README with new Schema API
  Cleanup some code and comments to make it consistent
  Convert tests to create objects with property objects
  Update example apps with new schema API
  Remove confusion between propTypes and objectTypes
  Simplify object schema info returned from RPC
  RPC now keeps object keys in the same order
  Change schema API to take properties as an object
  Add method to clear mutation listeners in RPC client
  Plug small leak from not releasing a JSStringRef
  Make RJSStringForValue use consistent exception style
  Improve error messages inside RJSUtil
2016-01-14 15:39:45 -08:00
Ari Lazier 63ffc760bd merge latest from master 2016-01-13 12:46:07 -08:00
Ari Lazier 211f0eddd5 improve exception message 2016-01-11 19:42:20 -08:00
Ari Lazier 1c5f22bd4d fix for query tests 2016-01-11 19:32:46 -08:00
Ari Lazier 4735a91f8c run tests 2016-01-08 16:33:53 -08:00
Scott Kyle c34990759d Add test that checks schema validation 2016-01-05 13:54:03 -08:00
Scott Kyle 9be1331dbf Convert tests to create objects with property objects
This makes it more readable and will be the preferred syntax in the documentation (and is much less likely to be deprecated in the future!).
2016-01-05 13:54:03 -08:00
Scott Kyle 43e14093cc Change schema API to take properties as an object
The keys are names of the properties, which is more natural in JS, but will cause issues with ability to create objects where arrays of values. This feature will be removed in a subsequent commit.
2016-01-05 13:40:57 -08:00
Scott Kyle 2bfedc5d8a Merge branch 'sk-project-cleanup'
* sk-project-cleanup:
  Fix for failing React tests
  Rename JS test files to be consistent
  Cleanup and fix resolving JS test files
  Cleanup source groups in Xcode project
  Move RealmJS.mm to correct location
2016-01-05 13:19:02 -08:00
Scott Kyle 632f9d737e Add methods to create snapshot of List and Results
The Results class was updated to match the style of List and include a flag (m_live) that determines if it should sync updates. If an object in the static Results is deleted, then it will return null.
2015-12-30 16:53:26 -08:00
Scott Kyle 3739fab57f Fix for failing React tests
Since the JS test modules have been renamed to have consistent naming, we add a method to actually run the test methods to use our existing abstraction.
2015-12-30 16:47:16 -08:00
Scott Kyle b3a0627a51 Rename JS test files to be consistent 2015-12-29 14:56:38 -08:00
Scott Kyle 4109c86343 Make Realm object properties enumerable 2015-12-08 03:26:57 -08:00
Scott Kyle be0c2a91ea Fix RPC client error after deleting objects
Specifically for objects with lists, since the mutation listener would fire on a list that no longer is attached. If during the mutation listener that error is thrown, then the listener will be removed and the error will not be propagated.
2015-12-01 14:05:33 -08:00
Ari Lazier eb44b27633 move everything/rename to make room for android 2015-11-30 11:23:29 -08:00