merge latest master

This commit is contained in:
Ari Lazier 2016-08-19 09:23:14 -07:00
commit a3178506c4
23 changed files with 216 additions and 95 deletions

View File

@ -5,3 +5,5 @@
build/
node_modules/
vendor/
/tests/test-runners/

View File

@ -1,3 +1,14 @@
x.x.x Release notes (yyyy-MM-dd)
=============================================================
### Breaking changes
* Deprecate `Realm.Types`. Please specify the type name as lowercase string instead.
### Enhancements
* None
### Bugfixes
* None
0.14.2 Release notes (2016-7-11)
=============================================================
### Breaking changes

View File

@ -7,7 +7,7 @@
},
"dependencies": {
"react": "~15.2.0",
"react-native": "^0.29.0",
"react-native": "^0.31.0",
"realm": "file:../.."
}
}

View File

@ -29,7 +29,7 @@ if (typeof Realm != 'undefined') {
// The userAgent will be defined when running in a browser (such as Chrome debugging mode).
realmConstructor = require('./browser').default; // (exported as ES6 module)
// eslint-disable-next-line
} else if (typeof process == 'object' && ('' + process) == '[object process]') {
} else if (typeof process == 'object' && (('' + process) == '[object process]' || typeof jest == 'object')) {
// Prevent React Native packager from seeing this module.
var bindings = 'bindings';
realmConstructor = require(bindings)('realm').Realm;
@ -41,8 +41,7 @@ if (typeof Realm != 'undefined') {
Object.defineProperties(realmConstructor.Collection.prototype, arrayMethods);
// TODO: Remove this now useless object.
Object.defineProperty(realmConstructor, 'Types', {
value: Object.freeze({
var types = Object.freeze({
'BOOL': 'bool',
'INT': 'int',
'FLOAT': 'float',
@ -52,7 +51,24 @@ Object.defineProperty(realmConstructor, 'Types', {
'DATA': 'data',
'OBJECT': 'object',
'LIST': 'list',
})
});
Object.defineProperty(realmConstructor, 'Types', {
get: function() {
if (typeof console != 'undefined') {
/* global console */
/* eslint-disable no-console */
var stack = new Error().stack.split("\n").slice(2).join("\n");
var msg = '`Realm.Types` is deprecated! Please specify the type name as lowercase string instead!\n'+stack;
if (console.warn != undefined) {
console.warn(msg);
}
else {
console.log(msg);
}
/* eslint-enable no-console */
}
return types;
}
});
module.exports = realmConstructor;

View File

@ -19,11 +19,13 @@
#import "RealmReact.h"
#import "RealmAnalytics.h"
#import "RCTBridge.h"
#import "RCTJavaScriptExecutor.h"
#import "jsc_init.h"
#import "shared_realm.hpp"
#import "realm_coordinator.hpp"
#import <objc/runtime.h>
#import <arpa/inet.h>
#import <ifaddrs.h>
#import <netdb.h>
@ -44,7 +46,7 @@ using namespace realm::rpc;
@interface NSObject ()
- (instancetype)initWithJSContext:(JSContext *)context;
- (instancetype)initWithJSContext:(JSContext *)context onThread:(NSThread *)thread;
- (JSGlobalContextRef)ctx;
- (JSContext *)context;
@end
extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executor, bool create) {
@ -69,7 +71,7 @@ extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executo
object_setIvar(executor, contextIvar, rctJSContext);
}
return [rctJSContext ctx];
return [rctJSContext context].JSGlobalContextRef;
}
@interface RealmReact () <RCTBridgeModule>

View File

@ -4,7 +4,7 @@ set -e
set -o pipefail
# Set to "latest" for the latest build.
: ${REALM_CORE_VERSION:=1.4.0}
: ${REALM_CORE_VERSION:=1.5.0}
if [ "$1" = '--version' ]; then
echo "$REALM_CORE_VERSION"

View File

@ -157,6 +157,18 @@ case "$TARGET" in
node "$SRCROOT/tests"
;;
"test-runners")
npm install
scripts/download-core.sh node
src/node/build-node.sh $CONFIGURATION
for runner in ava mocha jest; do
pushd "$SRCROOT/tests/test-runners/$runner"
npm install
npm test
popd
done
;;
"object-store")
pushd src/object-store
cmake -DCMAKE_BUILD_TYPE=$CONFIGURATION .

View File

@ -32,6 +32,10 @@
02F59ED51C88F1B6007F774C /* weak_realm_notifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59ED11C88F1B6007F774C /* weak_realm_notifier.cpp */; };
02F59EE21C88F2BB007F774C /* realm_coordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EDB1C88F2BA007F774C /* realm_coordinator.cpp */; };
02F59EE31C88F2BB007F774C /* transact_log_handler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EDD1C88F2BB007F774C /* transact_log_handler.cpp */; };
5DC74A781D623C9800D77A4F /* handover.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DC74A751D623C8700D77A4F /* handover.cpp */; };
5DC74A791D623CA200D77A4F /* handover.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DC74A751D623C8700D77A4F /* handover.cpp */; };
5DC74A7A1D623CA800D77A4F /* thread_confined.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DC74A721D623C7A00D77A4F /* thread_confined.cpp */; };
5DC74A7B1D623CA800D77A4F /* thread_confined.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5DC74A721D623C7A00D77A4F /* thread_confined.cpp */; };
F60102D31CBB966E00EC01BA /* js_realm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 029048071C0428DF00ABDED4 /* js_realm.cpp */; };
F60102D41CBB96AB00EC01BA /* index_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EAF1C88F17D007F774C /* index_set.cpp */; };
F60102D51CBB96AE00EC01BA /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EB11C88F17D007F774C /* list.cpp */; };
@ -163,6 +167,11 @@
02F59EDE1C88F2BB007F774C /* transact_log_handler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = transact_log_handler.hpp; sourceTree = "<group>"; };
02F59EDF1C88F2BB007F774C /* weak_realm_notifier_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = weak_realm_notifier_base.hpp; sourceTree = "<group>"; };
02F59EE01C88F2BB007F774C /* weak_realm_notifier.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = weak_realm_notifier.hpp; sourceTree = "<group>"; };
5DC74A721D623C7A00D77A4F /* thread_confined.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = thread_confined.cpp; path = src/thread_confined.cpp; sourceTree = "<group>"; };
5DC74A731D623C7A00D77A4F /* thread_confined.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = thread_confined.hpp; path = src/thread_confined.hpp; sourceTree = "<group>"; };
5DC74A751D623C8700D77A4F /* handover.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = handover.cpp; sourceTree = "<group>"; };
5DC74A761D623C8700D77A4F /* handover.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = handover.hpp; sourceTree = "<group>"; };
5DC74A7C1D623CED00D77A4F /* compiler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compiler.hpp; sourceTree = "<group>"; };
F60102CF1CBB814A00EC01BA /* node_init.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = node_init.hpp; sourceTree = "<group>"; };
F60102D11CBB865A00EC01BA /* jsc_init.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsc_init.hpp; sourceTree = "<group>"; };
F60102E31CBBB19700EC01BA /* node_object_accessor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = node_object_accessor.hpp; sourceTree = "<group>"; };
@ -375,6 +384,7 @@
isa = PBXGroup;
children = (
02E008D11D10AB1B00F3AA37 /* atomic_shared_ptr.hpp */,
5DC74A7C1D623CED00D77A4F /* compiler.hpp */,
02E008D21D10AB1B00F3AA37 /* format.cpp */,
02E008D31D10AB1B00F3AA37 /* format.hpp */,
F6242B291D08EE9600BE1E03 /* thread_id.hpp */,
@ -420,6 +430,8 @@
02F59EBC1C88F17D007F774C /* schema.hpp */,
02F59EBD1C88F17D007F774C /* shared_realm.cpp */,
02F59EBE1C88F17D007F774C /* shared_realm.hpp */,
5DC74A721D623C7A00D77A4F /* thread_confined.cpp */,
5DC74A731D623C7A00D77A4F /* thread_confined.hpp */,
);
name = "Object Store";
path = "object-store";
@ -459,6 +471,8 @@
02414B9A1CE6AAEF00A8669F /* collection_change_builder.hpp */,
02414B9B1CE6AAEF00A8669F /* collection_notifier.cpp */,
02414B9C1CE6AAEF00A8669F /* collection_notifier.hpp */,
5DC74A751D623C8700D77A4F /* handover.cpp */,
5DC74A761D623C8700D77A4F /* handover.hpp */,
02414B9D1CE6AAEF00A8669F /* list_notifier.cpp */,
02414B9E1CE6AAEF00A8669F /* list_notifier.hpp */,
02414B9F1CE6AAEF00A8669F /* results_notifier.cpp */,
@ -832,6 +846,7 @@
F60102DB1CBB96C600EC01BA /* parser.cpp in Sources */,
F6E931BB1CFEAE310016AF14 /* collection_change_builder.cpp in Sources */,
F64A059B1D10D928004ACDBE /* format.cpp in Sources */,
5DC74A7B1D623CA800D77A4F /* thread_confined.cpp in Sources */,
F60102D51CBB96AE00EC01BA /* list.cpp in Sources */,
F6E931BC1CFEAE340016AF14 /* collection_notifier.cpp in Sources */,
F60102DC1CBB96C900EC01BA /* query_builder.cpp in Sources */,
@ -848,6 +863,7 @@
F60102D81CBB96BD00EC01BA /* results.cpp in Sources */,
F674784A1CC81F1900F9273C /* platform.cpp in Sources */,
F620F0581CB766DA0082977B /* node_init.cpp in Sources */,
5DC74A791D623CA200D77A4F /* handover.cpp in Sources */,
F60102D91CBB96C100EC01BA /* schema.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -857,6 +873,7 @@
buildActionMask = 2147483647;
files = (
02E008D51D10ABB600F3AA37 /* format.cpp in Sources */,
5DC74A7A1D623CA800D77A4F /* thread_confined.cpp in Sources */,
02414BA51CE6ABCF00A8669F /* collection_change_builder.cpp in Sources */,
02414BA61CE6ABCF00A8669F /* collection_notifier.cpp in Sources */,
F64A059D1D13710C004ACDBE /* thread_id.cpp in Sources */,
@ -864,6 +881,7 @@
02414BA81CE6ABCF00A8669F /* results_notifier.cpp in Sources */,
02414BA91CE6ABCF00A8669F /* collection_notifications.cpp in Sources */,
02F59EE31C88F2BB007F774C /* transact_log_handler.cpp in Sources */,
5DC74A781D623C9800D77A4F /* handover.cpp in Sources */,
F63FF2E81C159C4B00B3B8E0 /* platform.mm in Sources */,
02F59EC31C88F17D007F774C /* results.cpp in Sources */,
F63FF2E21C15921A00B3B8E0 /* base64.cpp in Sources */,

View File

@ -23,6 +23,7 @@
#include "results.hpp"
#include "list.hpp"
#include "object_store.hpp"
#include "parser.hpp"
#include "query_builder.hpp"
@ -40,9 +41,9 @@ class Results : public realm::Results {
Results() = default;
Results(SharedRealm r, Table& table) : realm::Results(r, table) {}
Results(SharedRealm r, Query q, SortOrder s = {}) : realm::Results(r, q, s) {}
Results(SharedRealm r, TableView tv, SortOrder s) : realm::Results(r, tv, s) {}
Results(SharedRealm r, LinkViewRef lv, util::Optional<Query> q = {}, SortOrder s = {}) : realm::Results(r, lv, q, s) {}
Results(SharedRealm r, Query q, SortDescriptor s = {}) : realm::Results(r, q, s) {}
Results(SharedRealm r, TableView tv, SortDescriptor s) : realm::Results(r, tv, s) {}
Results(SharedRealm r, LinkViewRef lv, util::Optional<Query> q = {}, SortDescriptor s = {}) : realm::Results(r, lv, q, s) {}
std::vector<std::pair<Protected<typename T::Function>, NotificationToken>> m_notification_tokens;
};
@ -169,7 +170,7 @@ typename T::Object ResultsClass<T>::create_sorted(ContextType ctx, const U &coll
ascending.push_back(argc == 1 ? true : !Value::to_boolean(ctx, arguments[1]));
}
std::vector<size_t> columns;
std::vector<std::vector<size_t>> columns;
columns.reserve(prop_count);
for (std::string &prop_name : prop_names) {
@ -177,10 +178,12 @@ typename T::Object ResultsClass<T>::create_sorted(ContextType ctx, const U &coll
if (!prop) {
throw std::runtime_error("Property '" + prop_name + "' does not exist on object type '" + object_schema.name + "'");
}
columns.push_back(prop->table_column);
columns.push_back({prop->table_column});
}
auto results = new realm::js::Results<T>(realm, collection.get_query(), {std::move(columns), std::move(ascending)});
auto table = realm::ObjectStore::table_for_object_type(realm->read_group(), object_schema.name);
auto results = new realm::js::Results<T>(realm, collection.get_query(),
{*table, std::move(columns), std::move(ascending)});
return create_object<T, ResultsClass<T>>(ctx, results);
}

View File

@ -14,8 +14,10 @@
"../object-store/src/results.cpp",
"../object-store/src/schema.cpp",
"../object-store/src/shared_realm.cpp",
"../object-store/src/thread_confined.cpp",
"../object-store/src/impl/collection_change_builder.cpp",
"../object-store/src/impl/collection_notifier.cpp",
"../object-store/src/impl/handover.cpp",
"../object-store/src/impl/list_notifier.cpp",
"../object-store/src/impl/realm_coordinator.cpp",
"../object-store/src/impl/results_notifier.cpp",

@ -1 +1 @@
Subproject commit c34b3db85d86bf542fb57cd34f393efeac87b929
Subproject commit c3e4be6d6cd0bf3e010e169b9793087e60eb52bb

View File

@ -50,13 +50,13 @@ module.exports = {
var prop = schemas.BasicTypes.properties[name];
var type = typeof prop == 'object' ? prop.type : prop;
if (type == Realm.Types.FLOAT || type == Realm.Types.DOUBLE) {
if (type == 'float' || type == 'double') {
TestCase.assertEqualWithTolerance(object[name], basicTypesValues[name], 0.000001);
}
else if (type == Realm.Types.DATA) {
else if (type == 'data') {
TestCase.assertArraysEqual(new Uint8Array(object[name]), RANDOM_DATA);
}
else if (type == Realm.Types.DATE) {
else if (type == 'date') {
TestCase.assertEqual(object[name].getTime(), basicTypesValues[name].getTime());
}
else {
@ -100,13 +100,13 @@ module.exports = {
TestCase.assertEqual(nullObject[name], null);
if (type == Realm.Types.FLOAT || type == Realm.Types.DOUBLE) {
if (type == 'float' || type == 'double') {
TestCase.assertEqualWithTolerance(object[name], basicTypesValues[name], 0.000001);
}
else if (type == Realm.Types.DATA) {
else if (type == 'data') {
TestCase.assertArraysEqual(new Uint8Array(object[name]), RANDOM_DATA);
}
else if (type == Realm.Types.DATE) {
else if (type == 'date') {
TestCase.assertEqual(object[name].getTime(), basicTypesValues[name].getTime());
}
else {

View File

@ -42,9 +42,9 @@ function convertValue(value, schema, type) {
});
}
typeConverters[Realm.Types.DATE] = function(value) { return new Date(value); };
typeConverters[Realm.Types.DATA] = function(value) { return new Uint8Array(value); };
typeConverters[Realm.Types.OBJECT] = convertValue;
typeConverters['date'] = function(value) { return new Date(value); };
typeConverters['data'] = function(value) { return new Uint8Array(value); };
typeConverters['object'] = convertValue;
function runQuerySuite(suite) {
var realm = new Realm({schema: suite.schema});

View File

@ -116,7 +116,7 @@ module.exports = {
}, 'The schema should be an array of ObjectSchema objects');
TestCase.assertThrows(function() {
new Realm({schema: [{properties: {intCol: Realm.Types.INT}}]});
new Realm({schema: [{properties: {intCol: 'int'}}]});
}, 'The schema should be an array of ObjectSchema objects');
},

View File

@ -23,7 +23,7 @@ var Realm = require('realm');
exports.TestObject = {
name: 'TestObject',
properties: {
doubleCol: Realm.Types.DOUBLE,
doubleCol: 'double',
}
};
@ -31,9 +31,9 @@ function PersonObject() {}
PersonObject.schema = {
name: 'PersonObject',
properties: {
name: Realm.Types.STRING,
age: Realm.Types.DOUBLE,
married: {type: Realm.Types.BOOL, default: false},
name: 'string',
age: 'double',
married: {type: 'bool', default: false},
}
};
PersonObject.prototype.description = function() {
@ -54,26 +54,26 @@ exports.PersonList = {
exports.BasicTypes = {
name: 'BasicTypesObject',
properties: {
boolCol: Realm.Types.BOOL,
intCol: Realm.Types.INT,
floatCol: Realm.Types.FLOAT,
doubleCol: Realm.Types.DOUBLE,
stringCol: Realm.Types.STRING,
dateCol: Realm.Types.DATE,
dataCol: Realm.Types.DATA,
boolCol: 'bool',
intCol: 'int',
floatCol: 'float',
doubleCol: 'double',
stringCol: 'string',
dateCol: 'date',
dataCol: 'data',
}
};
exports.NullableBasicTypes = {
name: 'NullableBasicTypesObject',
properties: {
boolCol: {type: Realm.Types.BOOL, optional: true},
intCol: {type: Realm.Types.INT, optional: true},
floatCol: {type: Realm.Types.FLOAT, optional: true},
doubleCol: {type: Realm.Types.DOUBLE, optional: true},
stringCol: {type: Realm.Types.STRING, optional: true},
dateCol: {type: Realm.Types.DATE, optional: true},
dataCol: {type: Realm.Types.DATA, optional: true},
boolCol: {type: 'bool', optional: true},
intCol: {type: 'int', optional: true},
floatCol: {type: 'float', optional: true},
doubleCol: {type: 'double', optional: true},
stringCol: {type: 'string', optional: true},
dateCol: {type: 'date', optional: true},
dataCol: {type: 'data', optional: true},
}
};
@ -92,8 +92,8 @@ exports.LinkTypes = {
name: 'LinkTypesObject',
properties: {
objectCol: 'TestObject',
objectCol1: {type: Realm.Types.OBJECT, objectType: 'TestObject'},
arrayCol: {type: Realm.Types.LIST, objectType: 'TestObject'},
objectCol1: {type: 'object', objectType: 'TestObject'},
arrayCol: {type: 'list', objectType: 'TestObject'},
}
};
@ -101,8 +101,8 @@ exports.IntPrimary = {
name: 'IntPrimaryObject',
primaryKey: 'primaryCol',
properties: {
primaryCol: Realm.Types.INT,
valueCol: Realm.Types.STRING,
primaryCol: 'int',
valueCol: 'string',
}
};
@ -110,8 +110,8 @@ exports.StringPrimary = {
name: 'StringPrimaryObject',
primaryKey: 'primaryCol',
properties: {
primaryCol: Realm.Types.STRING,
valueCol: Realm.Types.INT,
primaryCol: 'string',
valueCol: 'int',
}
};
@ -119,64 +119,64 @@ exports.AllTypes = {
name: 'AllTypesObject',
primaryKey: 'primaryCol',
properties: {
primaryCol: Realm.Types.STRING,
boolCol: Realm.Types.BOOL,
intCol: Realm.Types.INT,
floatCol: Realm.Types.FLOAT,
doubleCol: Realm.Types.DOUBLE,
stringCol: Realm.Types.STRING,
dateCol: Realm.Types.DATE,
dataCol: Realm.Types.DATA,
primaryCol: 'string',
boolCol: 'bool',
intCol: 'int',
floatCol: 'float',
doubleCol: 'double',
stringCol: 'string',
dateCol: 'date',
dataCol: 'data',
objectCol: 'TestObject',
arrayCol: {type: Realm.Types.LIST, objectType: 'TestObject'},
arrayCol: {type: 'list', objectType: 'TestObject'},
}
};
exports.DefaultValues = {
name: 'DefaultValuesObject',
properties: {
boolCol: {type: Realm.Types.BOOL, default: true},
intCol: {type: Realm.Types.INT, default: -1},
floatCol: {type: Realm.Types.FLOAT, default: -1.1},
doubleCol: {type: Realm.Types.DOUBLE, default: -1.11},
stringCol: {type: Realm.Types.STRING, default: 'defaultString'},
dateCol: {type: Realm.Types.DATE, default: new Date(1.111)},
dataCol: {type: Realm.Types.DATA, default: new ArrayBuffer(1)},
boolCol: {type: 'bool', default: true},
intCol: {type: 'int', default: -1},
floatCol: {type: 'float', default: -1.1},
doubleCol: {type: 'double', default: -1.11},
stringCol: {type: 'string', default: 'defaultString'},
dateCol: {type: 'date', default: new Date(1.111)},
dataCol: {type: 'data', default: new ArrayBuffer(1)},
objectCol: {type: 'TestObject', default: {doubleCol: 1}},
nullObjectCol: {type: 'TestObject', default: null},
arrayCol: {type: Realm.Types.LIST, objectType: 'TestObject', default: [{doubleCol: 2}]},
arrayCol: {type: 'list', objectType: 'TestObject', default: [{doubleCol: 2}]},
}
};
exports.QueryObject = {
name: 'QueryObject',
properties: [
{name: 'bool1', type: Realm.Types.BOOL},
{name: 'bool2', type: Realm.Types.BOOL},
{name: 'int1', type: Realm.Types.INT},
{name: 'int2', type: Realm.Types.INT},
{name: 'float1', type: Realm.Types.FLOAT},
{name: 'float2', type: Realm.Types.FLOAT},
{name: 'double1', type: Realm.Types.DOUBLE},
{name: 'double2', type: Realm.Types.DOUBLE},
{name: 'string1', type: Realm.Types.STRING},
{name: 'string2', type: Realm.Types.STRING},
{name: 'bool1', type: 'bool'},
{name: 'bool2', type: 'bool'},
{name: 'int1', type: 'int'},
{name: 'int2', type: 'int'},
{name: 'float1', type: 'float'},
{name: 'float2', type: 'float'},
{name: 'double1', type: 'double'},
{name: 'double2', type: 'double'},
{name: 'string1', type: 'string'},
{name: 'string2', type: 'string'},
]
};
exports.NullQueryObject = {
name: 'NullQueryObject',
properties: [
{name: 'bool1', type: Realm.Types.BOOL},
{name: 'bool2', type: Realm.Types.BOOL},
{name: 'int1', type: Realm.Types.INT},
{name: 'int2', type: Realm.Types.INT},
{name: 'float1', type: Realm.Types.FLOAT},
{name: 'float2', type: Realm.Types.FLOAT},
{name: 'double1', type: Realm.Types.DOUBLE},
{name: 'double2', type: Realm.Types.DOUBLE},
{name: 'string1', type: Realm.Types.STRING},
{name: 'string2', type: Realm.Types.STRING},
{name: 'bool1', type: 'bool'},
{name: 'bool2', type: 'bool'},
{name: 'int1', type: 'int'},
{name: 'int2', type: 'int'},
{name: 'float1', type: 'float'},
{name: 'float2', type: 'float'},
{name: 'double1', type: 'double'},
{name: 'double2', type: 'double'},
{name: 'string1', type: 'string'},
{name: 'string2', type: 'string'},
]
};

View File

@ -7,7 +7,7 @@
},
"dependencies": {
"react": "~15.2.0",
"react-native": "^0.29.0",
"react-native": "^0.31.0",
"react-native-fs": "^1.1.0",
"xmlbuilder": "^4.2.1",
"realm": "file:../..",

View File

@ -0,0 +1,8 @@
{
"scripts": {
"test": "ava"
},
"devDependencies": {
"ava": "^0.16.0"
}
}

View File

@ -0,0 +1,7 @@
import test from 'ava';
test('can require Realm', t => {
var realm = require('realm');
t.is('function', typeof realm);
t.is('Realm', realm.name);
});

View File

@ -0,0 +1,15 @@
{
"scripts": {
"test": "jest"
},
"devDependencies": {
"jest-cli": "^13.2.3"
},
"jest": {
"testEnvironment": "node",
"unmockedModulePathPatterns": [
"realm"
],
"testRegex": "test.js"
}
}

View File

@ -0,0 +1,7 @@
describe('Realm', function() {
it('should be requirable', function() {
var realm = require('realm');
expect(typeof realm).toBe('function');
expect(realm.name).toBe('Realm');
});
});

View File

@ -0,0 +1,8 @@
{
"scripts": {
"test": "mocha"
},
"devDependencies": {
"mocha": "^3.0.2"
}
}

View File

@ -0,0 +1,9 @@
var assert = require('assert');
describe('Realm', function() {
it('should be requirable', function() {
var realm = require('realm');
assert.equal(typeof realm, 'function');
assert.equal(realm.name, 'Realm');
});
});

1
tests/test-runners/node_modules/realm generated vendored Symbolic link
View File

@ -0,0 +1 @@
../../..