Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix heap space option, and add tests #24

Merged
merged 1 commit into from
Jun 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function launch(options, port) {
]

if (options.heap) {
args.push('-Xmx=' + options.heap)
args.push('-Xmx' + options.heap)
}

args.push(
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "local-dynamo",
"description": "A Node.js wrapper of AWS DynamoDB Local and utilities",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/Medium/local-dynamo",
"licenses": [
{
Expand All @@ -23,13 +23,17 @@
"type": "git",
"url": "https://github.com/Medium/local-dynamo.git"
},
"scripts": {
"test": "./node_modules/.bin/nodeunit test"
},
"dependencies": {
"flags": "0.1.2",
"kew": "0.4.0",
"metrics": "0.1.8",
"progress": "1.1.8"
},
"devDependencies": {
"aws-sdk": "^2.0.22"
"aws-sdk": "^2.0.22",
"nodeunit": "0.9.1"
}
}
33 changes: 33 additions & 0 deletions test/launch_test.js
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()
}