Skip to content

Commit

Permalink
Replace deprecated sys.puts calls with console.log in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwwit committed Jul 31, 2019
1 parent efc39e9 commit a9d93fb
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions example/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();

xhr.onreadystatechange = function() {
sys.puts("State: " + this.readyState);
console.log("State: " + this.readyState);

if (this.readyState == 4) {
sys.puts("Complete.\nBody length: " + this.responseText.length);
sys.puts("Body:\n" + this.responseText);
console.log("Complete.\nBody length: " + this.responseText.length);
console.log("Body:\n" + this.responseText);
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/test-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ assert.equal(2, xhr.HEADERS_RECEIVED);
assert.equal(3, xhr.LOADING);
assert.equal(4, xhr.DONE);

sys.puts("done");
console.log("done");
2 changes: 1 addition & 1 deletion tests/test-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var server = http.createServer(function (req, res) {
assert.equal(onreadystatechange, true);
assert.equal(readystatechange, true);
assert.equal(removed, true);
sys.puts("done");
console.log("done");
this.close();
}).listen(8000);

Expand Down
2 changes: 1 addition & 1 deletion tests/test-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ xhr.onreadystatechange = function() {
assert.equal("", this.getAllResponseHeaders());
assert.equal(null, this.getResponseHeader("Connection"));

sys.puts("done");
console.log("done");
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/test-redirect-302.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ xhr.onreadystatechange = function() {
if (this.readyState == 4) {
assert.equal(xhr.getRequestHeader('Location'), '');
assert.equal(xhr.responseText, "Hello World");
sys.puts("done");
console.log("done");
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/test-redirect-303.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ xhr.onreadystatechange = function() {
if (this.readyState == 4) {
assert.equal(xhr.getRequestHeader('Location'), '');
assert.equal(xhr.responseText, "Hello World");
sys.puts("done");
console.log("done");
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/test-redirect-307.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ xhr.onreadystatechange = function() {
if (this.readyState == 4) {
assert.equal(xhr.getRequestHeader('Location'), '');
assert.equal(xhr.responseText, "Hello World");
sys.puts("done");
console.log("done");
}
};

Expand Down
6 changes: 3 additions & 3 deletions tests/test-request-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var server = http.createServer(function (req, res) {

if (curMethod == methods.length - 1) {
this.close();
sys.puts("done");
console.log("done");
}
}).listen(8000);

Expand All @@ -47,7 +47,7 @@ function start(method) {
curMethod++;

if (curMethod < methods.length) {
sys.puts("Testing " + methods[curMethod]);
console.log("Testing " + methods[curMethod]);
start(methods[curMethod]);
}
}
Expand All @@ -58,5 +58,5 @@ function start(method) {
xhr.send();
}

sys.puts("Testing " + methods[curMethod]);
console.log("Testing " + methods[curMethod]);
start(methods[curMethod]);
2 changes: 1 addition & 1 deletion tests/test-request-protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var runSync = function() {
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
assert.equal("Hello World", this.responseText);
sys.puts("done");
console.log("done");
}
};
xhr.open("GET", url, false);
Expand Down

0 comments on commit a9d93fb

Please sign in to comment.