Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Got rid of some unnecessary console.log

  • Loading branch information...
commit 9c4ed5c156ae0e8bc4cb2bd538b84efdde21489a 1 parent bf6332b
@assaf authored
View
2  lib/zombie/bcat.coffee
@@ -87,5 +87,5 @@ exports.bcat = (input, port = 8091, browser)->
bcat = new BCat
input ||= process.openStdin()
bcat.serve input, port
- console.log "open your browser on http://127.0.0.1:#{port}/"
+ process.stdout.write "open your browser on http://127.0.0.1:#{port}/\n\n"
bcat.open browser, port
View
16 lib/zombie/browser.coffee
@@ -834,18 +834,18 @@ class Browser extends EventEmitter
# debugging and submitting error reports.
dump: ->
indent = (lines)-> lines.map((l) -> " #{l}\n").join("")
- console.log "Zombie: #{VERSION}\n"
- console.log "URL: #{@window.location.href}"
- console.log "History:\n#{indent @window.history.dump()}"
- console.log "Cookies:\n#{indent @_cookies.dump()}"
- console.log "Storage:\n#{indent @_storages.dump()}"
- console.log "Eventloop:\n#{indent @_eventloop.dump()}"
+ process.stdout.write "Zombie: #{VERSION}\n\n"
+ process.stdout.write "URL: #{@window.location.href}\n"
+ process.stdout.write "History:\n#{indent @window.history.dump()}\n"
+ process.stdout.write "Cookies:\n#{indent @_cookies.dump()}\n"
+ process.stdout.write "Storage:\n#{indent @_storages.dump()}\n"
+ process.stdout.write "Eventloop:\n#{indent @_eventloop.dump()}\n"
if @document
html = @document.outerHTML
html = html.slice(0, 497) + "..." if html.length > 497
- console.log "Document:\n#{indent html.split("\n")}"
+ process.stdout.write "Document:\n#{indent html.split("\n")}\n"
else
- console.log "No document" unless @document
+ process.stdout.write "No document\n" unless @document
# Represents credentials for a given host.
View
4 lib/zombie/cookies.coffee
@@ -106,10 +106,10 @@ class Cookies
get: ->
return @browser.cookies(@location.hostname, @location.pathname)
- # Used to dump state to console (debuggin)
+ # Used to dump state to console (debugging)
dump: ->
for cookie in @_cookies.sort(Tough.cookieCompare)
- console.log cookie.toString()
+ process.stdout.write cookie.toString() + "\n"
# browser.saveCookies uses this
save: ->
View
2  lib/zombie/helpers.coffee
@@ -3,7 +3,7 @@ deprecated = (message)->
@shown ||= {}
unless @shown[message]
@shown[message] = true
- console.log message
+ process.stderr.write message
module.exports =
View
3  lib/zombie/resources.coffee
@@ -134,7 +134,8 @@ class Resources extends Array
# Dump all resources to the console by calling toString.
dump: ->
- console.log this.toString()
+ process.stdout.write this.toString()
+ process.stdout.write "\n"
toString: ->
@map((resource)-> resource.toString()).join("\n")
View
1  lib/zombie/xhr.coffee
@@ -68,7 +68,6 @@ XMLHttpRequest = (window)->
# Make the actual request: called again when dealing with a redirect.
window.browser.resources.request method, url, data, headers, (error, response)=>
if error
- console.error "XHR error", error
@_error = new html.DOMException(html.NETWORK_ERR, error.message)
stateChanged 4
reset()
View
1  test/cookies_test.coffee
@@ -151,7 +151,6 @@ describe "Cookies", ->
browser.visit "http://localhost:3003/cookies3", done
it "should retain last value", ->
- console.log browser.cookies().all()
assert.equal browser.cookies().get("_dup"), "three"
it "should only retain last cookie", ->
dups = browser.cookies().all().filter((c)-> c.key == "_dup")
View
2  test/forms_test.coffee
@@ -600,13 +600,11 @@ describe "Forms", ->
before (done)->
browser.visit "http://localhost:3003/forms/form", ->
- console.log "Visit ..."
browser.fill("Name", "ArmBiter").fill("likes", "Arm Biting").check("You bet").
check("Certainly").choose("Scary").select("state", "dead").select("looks", "Choose one").
select("#field-hobbies", "Eat Brains").select("#field-hobbies", "Sleep").check("Brains?").
fill('#address1_city', 'Paris').fill('#address1_street', 'CDG').
fill('#address2_city', 'Mikolaiv').fill('#address2_street', 'PGS')
- console.log "Waiting ..."
browser.querySelector("form").submit()
browser.wait done
View
1  test/iframe_test.coffee
@@ -89,7 +89,6 @@ describe "IFrame", ->
res.send """
<script>
window.addEventListener("message", function(event) {
- console.log(event.origin)
if (event.data == "ping")
event.source.postMessage("pong " + event.origin);
})
View
1  test/script_test.coffee
@@ -212,7 +212,6 @@ describe "Scripts", ->
var foo = "NotOne";
var e_foo = e("foo");
var qux = window.eval.call(window, "foo");
- console.log(qux)
document.title = eval('e_foo + bar + baz + qux');
})();
Please sign in to comment.
Something went wrong with that request. Please try again.