Accept a custom path for the realm module (#725)

* Accept a custom path for the realm module

* Use the correct argument for the realm module path
This commit is contained in:
Radu Tutueanu 2016-12-08 13:01:41 +01:00 committed by GitHub
parent 87260a42c9
commit 8eb639678e
3 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@ function createNotificationTest(config, getObservable, addListener, removeListen
return new Promise((resolve, reject) => {
let realm = new Realm(config);
let observable = getObservable(realm);
let worker = new Worker(__dirname + '/worker-tests-script.js');
let worker = new Worker(__dirname + '/worker-tests-script.js', [require.resolve('realm')]);
// Test will fail if it does not receive a change event within a second.
let timer = setTimeout(() => {

View File

@ -21,7 +21,7 @@
'use strict';
const Realm = require('realm');
const Realm = require(process.argv[2]);
process.on('message', (message) => {
process.send(handleMessage(message));

View File

@ -21,8 +21,8 @@
'use strict';
class Worker {
constructor(script) {
this._process = require('child_process').fork(script);
constructor(script, args) {
this._process = require('child_process').fork(script, args);
this._process.on('message', (message) => {
if (this.onmessage) {