Make all tests explicitly require realm module

This commit is contained in:
Scott Kyle 2015-10-08 16:19:19 -07:00
parent 3f3710339f
commit 88352721f7
8 changed files with 15 additions and 2 deletions

View File

@ -18,6 +18,7 @@
'use strict';
var Realm = require('realm');
var TestCase = require('./asserts');
var schemas = require('./schemas');

View File

@ -18,6 +18,7 @@
'use strict';
var Realm = require('realm');
var TestCase = require('./asserts');
var schemas = require('./schemas');

View File

@ -111,6 +111,9 @@ static void DeleteRealmFilesAtPath(NSString *path) {
[RealmJS initializeContext:context.JSGlobalContextRef];
// Expose the global Realm object as a global 'realm' CommonJS module.
[moduleLoader addGlobalModuleObject:context[@"Realm"] forName:@"realm"];
NSError *error;
JSValue *testObjects = [moduleLoader loadModuleFromURL:scriptURL error:&error];

View File

@ -18,6 +18,7 @@
'use strict';
var Realm = require('realm');
var TestCase = require('./asserts');
var schemas = require('./schemas');
var util = require('./util');

View File

@ -18,6 +18,7 @@
'use strict';
var Realm = require('realm');
var TestCase = require('./asserts');
var schemas = require('./schemas');

View File

@ -1,5 +1,8 @@
{
"name": "realm-tests",
"version": "0.0.1",
"private": true
"private": true,
"dependencies": {
"realm": "file:../lib"
}
}

View File

@ -18,6 +18,8 @@
'use strict';
var Realm = require('realm');
var TestObjectSchema = {
name: 'TestObject',
properties: [
@ -107,4 +109,3 @@ var DefaultValuesObjectSchema = {
]
};
exports.DefaultValues = DefaultValuesObjectSchema;

View File

@ -18,6 +18,8 @@
'use strict';
var Realm = require('realm');
exports.realmPathForFile = function(str) {
var path = Realm.defaultPath;
return path.substring(0, path.lastIndexOf("/") + 1) + str;