mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 16:47:58 -05:00
26 lines
696 B
CoffeeScript
26 lines
696 B
CoffeeScript
|
# Karma has real issues logging arbitrary objects
|
||
|
# But we log them all the time
|
||
|
# Wrapping console.log so this stops messing up our tests.
|
||
|
|
||
|
ll = console.log
|
||
|
|
||
|
console.log = (splat...) ->
|
||
|
try
|
||
|
s = (JSON.stringify(i) for i in splat)
|
||
|
ll(_.string.join(', ', s...))
|
||
|
catch TypeError
|
||
|
console.log('could not log what you tried to log')
|
||
|
|
||
|
console.warn = (splat...) ->
|
||
|
console.log("WARN", splat...)
|
||
|
|
||
|
console.error = (splat...) ->
|
||
|
console.log("ERROR", splat...)
|
||
|
|
||
|
|
||
|
# When the page loads the first time, it doesn't actually load if there's no 'me' loaded.
|
||
|
# Get past this by creating a fake 'me'
|
||
|
|
||
|
#User = require 'models/User'
|
||
|
#auth = require 'lib/auth'
|
||
|
#auth.me = new User({anonymous:true})
|