Skip to content

Commit 50a09fc

Browse files
committed
Adding a test of process termination from an inner context.
1 parent 3b58b07 commit 50a09fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graal-nodejs/test/graal/unit/spawn.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,11 @@ describe('Spawn', function () {
113113
assert.strictEqual(result.status, 1);
114114
});
115115
}
116+
it('should finish gracefully when the process is terminated from an inner context', function () {
117+
var code = `require('vm').runInNewContext('process.exit()', { process: process })`;
118+
var result = spawnSync(process.execPath, ['-e', code]);
119+
assert.strictEqual(result.stdout.toString(), '');
120+
assert.strictEqual(result.stderr.toString(), '');
121+
assert.strictEqual(result.status, 0);
122+
});
116123
});

0 commit comments

Comments
 (0)