-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
At the moment you are testing the string that gets returned out of the handler function in src/handler.js
I don't think this is a good practice.
I would say a better test would be to test what data the response.end(data) is called on
Something like:
tape('handler', function (t) {
handler({ url: '/' }, {
writeHead: function (status, obj) {
t.equal(status, 200);
t.equal(obj, ...);
},
end: function (data) {
t.equal(data, ...);
}
}
}
I'm not sure if that will work, but something similar to that
Metadata
Metadata
Assignees
Labels
No labels