Fix running nested-list-helper.js with node 8

This commit is contained in:
Thomas Goyne 2018-03-02 12:06:00 -08:00
parent 302db024bf
commit 5ff5df97be
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,8 @@ const realmName = process.argv[4];
const realmModule = process.argv[5];
const Realm = require(realmModule);
// Ensure that schemas.js gets the correct module with `require('realm')`
require.cache[require.resolve('realm')] = require.cache[require.resolve(realmModule)];
let schemas = require(process.argv[2]);
function createObjects(user) {

View File

@ -69,8 +69,8 @@ function runOutOfProcess() {
try {
execFile(process.execPath, args, {cwd: tmpDir.name}, (error, stdout, stderr) => {
if (error) {
console.error("runOutOfProcess failed\n", error);
reject(new Error(`Running ${modulePath} failed. error: ${error}`));
console.error("runOutOfProcess failed\n", error, stdout, stderr);
reject(new Error(`Running ${args[0]} failed. error: ${error}`));
return;
}