Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
fig bugs in login report
Commit Description:
fig bugs in login report
var test = require ( 'tape' )
var isFunction = require ( './' )
var parse = require ( 'acorn' ). parse
test ( 'throws if not a node' , function ( t ) {
t . plan ( 2 )
t . throws ( function () { isFunction ( null ) })
t . throws ( function () { isFunction ({ whatever : 'xyz' }) })
})
test ( 'FunctionDeclaration' , function ( t ) {
t . plan ( 1 )
t . ok ( isFunction ( parse ( 'function a () {}' ). body [ 0 ]))
})
test ( 'ArrowFunction' , function ( t ) {
t . plan ( 1 )
t . ok ( isFunction ( parse ( '(() => {})' ). body [ 0 ]. expression ))
})
test ( 'FunctionExpression' , function ( t ) {
t . plan ( 2 )
t . ok ( isFunction ( parse ( '(function () {})' ). body [ 0 ]. expression ))
t . ok ( isFunction ( parse ( '(function a () {})' ). body [ 0 ]. expression ))
})
test ( 'anything else' , function ( t ) {
t . plan ( 3 )
t . notOk ( isFunction ( parse ( '10' ). body [ 0 ]))
t . notOk ( isFunction ( parse ( 'class A {}' ). body [ 0 ]))
t . notOk ( isFunction ( parse ( 'var x = () => {}' ). body [ 0 ]))
})
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings