coffeelint-no-focused-jasmine-specs
Version:
CoffeeLint rule to ensure that all your jasmine specs run
59 lines (46 loc) • 1.54 kB
text/coffeescript
NoFocusedJasmineSpecs = require '../../src/no_focused_jasmine_specs'
coffeelint = require 'coffeelint'
coffeelint.registerRule NoFocusedJasmineSpecs
describe 'test', ->
beforeAll ->
no_focused_jasmine_specs:
level: 'warn'
describe 'a lint free spec', ->
beforeEach ->
passingSpec = '''
describe "A focused suite", ->
it "contains a spec", ->
expect(true).toBe true
'''
it 'has no errors', ->
expect(@errors.length).toBe 0
describe 'a focused describe block', ->
beforeEach ->
fdescribeSpec = '''
fdescribe "A focused suite", ->
it "contains a spec", ->
expect(true).toBe false
'''
it 'has an error on line 1', ->
expect(@errors.length).toBe 1
error = @errors[0]
expect(error.level).toBe 'warn'
expect(error.lineNumber).toBe 1
expect(error.rule).toBe 'no_focused_jasmine_specs'
describe 'a focused it spec', ->
beforeEach ->
fitSpec = '''
describe "A suite", ->
fit "contains a focus spec", ->
expect(true).toBe false
'''
it 'has an error on line 1', ->
expect(@errors.length).toBe 1
error = @errors[0]
expect(error.level).toBe 'warn'
expect(error.lineNumber).toBe 2
expect(error.rule).toBe 'no_focused_jasmine_specs'