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

Discovered tests that weren't properly running #1570

Merged
merged 2 commits into from May 13, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/server.js
Expand Up @@ -94,7 +94,7 @@ exports.createPostValidator = function (text, reqContentType) {
assert.ok(~req.headers['content-type'].indexOf(reqContentType))
}
resp.writeHead(200, {'content-type':'text/plain'})
resp.write('OK')
resp.write(r)
resp.end()
})
}
Expand Down
2 changes: 2 additions & 0 deletions tests/test-body.js
Expand Up @@ -20,6 +20,8 @@ function addTest(name, data) {
t.equal(err, null)
if (data.expectBody && Buffer.isBuffer(data.expectBody)) {
t.deepEqual(data.expectBody.toString(), body.toString())
} else if (data.expectBody) {
t.deepEqual(data.expectBody, body)
}
t.end()
})
Expand Down
9 changes: 5 additions & 4 deletions tests/test-pipes.js
Expand Up @@ -80,7 +80,7 @@ tape('piping to a request object', function(t) {
}, function(err, res, body) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.equal(body, 'OK')
t.equal(body, 'mydata')
t.end()
})
mydata.pipe(r1)
Expand All @@ -90,8 +90,9 @@ tape('piping to a request object', function(t) {
})

tape('piping to a request object with a json body', function(t) {
s.once('/push-json', server.createPostValidator('{"foo":"bar"}', 'application/json'))

var obj = {foo: 'bar'}
var json = JSON.stringify(obj)
s.once('/push-json', server.createPostValidator(json, 'application/json'))
var mybodydata = new stream.Stream()
mybodydata.readable = true

Expand All @@ -101,7 +102,7 @@ tape('piping to a request object with a json body', function(t) {
}, function(err, res, body) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.equal(body, 'OK')
t.deepEqual(body, obj)
t.end()
})
mybodydata.pipe(r2)
Expand Down