Commit Graph

21 Commits

Author SHA1 Message Date
Ari Lazier 841f45a7b2 change the license before starting the beta 2015-10-27 14:15:21 -07:00
Scott Kyle 0055d0510c Make List objects work with Object.keys in Chrome
Rather than using Object.preventExtensions to throw exceptions when setting any out-of-bounds index, we must instead compromise by only throwing for the common cases, which are -1 and list.length. Having Object.keys() support is essential for List to work with React Native ListViewDataSource.

Resolves #80
2015-10-21 13:11:41 -07:00
Scott Kyle c8c1910910 Expose global cleanupTestRealms function
This handles clearing out all of the test files between each test case.
2015-10-14 15:26:05 -07:00
Scott Kyle dc84ac63b6 Merge branch 'sk-react-framework' into sk-test-suite
* sk-react-framework: (27 commits)
  Change RealmReact to be a dynamic framework
  finish Array to List rename
  RJSArray -> RJSList
  move property getters to object store code
  move List class to its own file
  ObjectArray -> List
  Add Notification constructor and destructor
  Small improvement to notifications test
  RJSException no longer requires JS strings
  Protect realm and callback from GC in addNotification
  Add comments
  pr fixes
  minimal tests for migrations
  Check for NaN inside RJSValidatedValueToNumber
  allow running all tests at the same path by invalidating all cached realm paths between test runs
  Native methods should convert to numbers/bools
  Out of bounds getters for Results return undefined
  Out of bounds list item getters return undefined
  Consolidate code that verifies array index bounds
  Add list item setters in JS
  ...
2015-10-14 02:12:50 -07:00
Scott Kyle c2e51ab541 Check for NaN inside RJSValidatedValueToNumber
Turns out this API can return NaN without an exception. Also added tests to make sure these conversions either work or throw exceptions in the appropriate places.
2015-10-12 16:50:45 -07:00
Scott Kyle 6788cd6f3d Out of bounds list item getters return undefined
Resolves #50
2015-10-12 15:25:39 -07:00
Scott Kyle ae9ae4dc77 Add list item setters in JS
Added a test and made other array tests syntactically consistent. Resolves #45
2015-10-12 15:25:39 -07:00
Scott Kyle 515ece8fdd Remove duplicated test in ArrayTests.js
This must have been accidentally copy-pasted from ObjectTests.js
2015-10-12 15:25:38 -07:00
Scott Kyle c600af9182 Mutating lists outside transaction should throw 2015-10-12 02:23:09 -07:00
Scott Kyle 88352721f7 Make all tests explicitly require realm module 2015-10-08 16:19:19 -07:00
Scott Kyle db80c3a89a Refactor tests to run again inside Xcode
Added a CommonJS module loader that is used by XCTestCase subclass to load and run the tests.
2015-10-08 15:54:30 -07:00
Ari Lazier 68603c2620 fix exports 2015-10-08 15:51:46 -07:00
Ari Lazier 08fada74d6 fix so that RealmJS tests work again 2015-10-08 15:50:10 -07:00
Ari Lazier 55a07c99dc react test app 2015-10-08 15:50:10 -07:00
Scott Kyle 70ee822f19 Update splice method to mimic JS standard
It now will return the removed elements, and clamps the first two arguments to be acceptable values rather than throwing an exception.
2015-09-28 16:00:24 -07:00
Ari Lazier fbf2399140 tests and bugfixes for splice and shift 2015-08-28 15:11:50 -07:00
Ari Lazier ddbc6eb4c9 test for pop 2015-08-28 14:49:15 -07:00
Ari Lazier bd39239f00 array mutation functions 2015-08-28 14:41:30 -07:00
Ari Lazier e84c81542f fix for array enumeration, test array.push 2015-08-27 13:33:20 -07:00
Ari Lazier ccd2301d9e todo example 2015-08-24 09:22:37 -07:00
Ari Lazier f7b4fd6f4a test existing array functionality 2015-08-14 10:47:56 -07:00