Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 0.855 kB
path = require 'path'
vows = require 'vows'
assert = require 'assert'
coffeelint = require path.join('..', 'lib', 'coffeelint')
vows.describe('throw').addBatch({
'Throwing strings' :
topic : '''
throw 'my error'
throw "#{1234}"
throw """
long string
"""
'''
'is forbidden by default' : (source) ->
errors = coffeelint.lint(source)
assert.lengthOf(errors, 3)
error = errors[0]
assert.equal(error.message, 'Throwing strings is forbidden')
assert.equal(error.rule, 'no_throwing_strings')
'can be permittted' : (source) ->
config = {no_throwing_strings : {level : 'ignore'}}
errors = coffeelint.lint(source, config)
assert.isEmpty(errors)
}).export(module)
Jump to Line
Something went wrong with that request. Please try again.