Skip to content

Commit

Permalink
correct initialization in post-data-concat-test
Browse files Browse the repository at this point in the history
move initialization and finalization into before and after block
  • Loading branch information
rhjyy committed Feb 8, 2019
1 parent 4d4a86d commit 03fbd21
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/post-data-concat-test.js
Expand Up @@ -7,6 +7,16 @@ var http = require('http');


describe('post data concat test', function () {
var server = http.createServer(function (req, res) { });

before(function () {
server.listen(51515);
});

after(function () {
server.close();
});

it('should consider the situation about multi-byte character between two tcp packets', function (done) {
var check = function (a, b) {
if (a && b) {
Expand All @@ -16,7 +26,6 @@ describe('post data concat test', function () {
};

var wsdl = 'test/wsdl/default_namespace.wsdl';
var server = http.createServer(function (req, res) { });
var xml = fs.readFileSync(wsdl, 'utf8');
var service = {
MyService: {
Expand All @@ -29,7 +38,6 @@ describe('post data concat test', function () {
}
};

server.listen(51515);
soap.listen(server, '/wsdl', service, xml);

var postdata = "";
Expand All @@ -42,7 +50,7 @@ describe('post data concat test', function () {
}, function (error, client) {
assert(!error);
client.MyOperation(postdata, function (error, response) {
server.close();
assert(!error);
});
});

Expand Down

0 comments on commit 03fbd21

Please sign in to comment.