-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Medium/nick-local
fix heap space option, and add tests
- Loading branch information
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2015 A Medium Corporation. | ||
|
||
var localDynamo = require('../lib/launch') | ||
|
||
exports.testMemory = function (test) { | ||
var dynamo = localDynamo.launch({ | ||
port: 8676, | ||
heap: '512m' | ||
}) | ||
dynamo.stdout.on('data', function (data) { | ||
console.log('stdout', data.toString()) | ||
}) | ||
dynamo.stderr.on('data', function (data) { | ||
console.log('stderr', data.toString()) | ||
}) | ||
|
||
var finished = false | ||
|
||
dynamo.on('exit', function (code) { | ||
if (finished) return | ||
|
||
finished = true | ||
test.ok(false, 'Unexpected exit code ' + code) | ||
test.done() | ||
}) | ||
|
||
// If everything goes well after 5 seconds, then we're done! | ||
setTimeout(function () { | ||
finished = true | ||
dynamo.kill() | ||
test.done() | ||
}, 5000).unref() | ||
} |