protocol: adding error job to log error with custom protocols
This commit is contained in:
parent
e5380fd671
commit
9ab53b0e4b
5 changed files with 49 additions and 2 deletions
|
@ -58,6 +58,21 @@ describe 'protocol module', ->
|
|||
assert false, 'Got error: ' + errorType + ' ' + error
|
||||
protocol.unregisterProtocol 'atom-string-job'
|
||||
|
||||
it 'returns RequestErrorJob should send error', (done) ->
|
||||
data = 'valar morghulis'
|
||||
job = new protocol.RequestErrorJob(-6)
|
||||
handler = remote.createFunctionWithReturnValue job
|
||||
protocol.registerProtocol 'atom-error-job', handler
|
||||
|
||||
$.ajax
|
||||
url: 'atom-error-job://fake-host'
|
||||
success: (response) ->
|
||||
assert false, 'should not reach here'
|
||||
error: (xhr, errorType, error) ->
|
||||
assert errorType, 'error'
|
||||
protocol.unregisterProtocol 'atom-error-job'
|
||||
done()
|
||||
|
||||
it 'returns RequestBufferJob should send buffer', (done) ->
|
||||
data = new Buffer("hello")
|
||||
job = new protocol.RequestBufferJob(data: data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue