karma-coffee-preprocessor icon indicating copy to clipboard operation
karma-coffee-preprocessor copied to clipboard

Line number for coffee script tests are incorrect

Open evgenyneu opened this issue 10 years ago • 7 comments

Hi, can anyone help me to setup karma to show error line numbers correctly for CoffeScript tests?

For the following test the report contains text test_spec.coffee:3:26. I assume that 3 is the line number, which is not quite right. It should be 2, not 3.

describe 'test', ->
  it 'fails', -> expect(false).toBe true

Test output:

Chrome 30.0.1599 (Mac OS X 10.8.4) test fails FAILED
    Expected false to be true.
    Error: Expected false to be true.
        at null.<anonymous> (...test_spec.coffee:3:26)

My config:

preprocessors: {
  '**/*.coffee': ['coffee']
},
coffeePreprocessor: {
  options: {
    bare: true,
    sourceMap: true
  },
  transformPath: function(path) {
    return path.replace(/\.js$/, '.coffee');
  }
}

I am using: [email protected] [email protected] [email protected]

Thank you

evgenyneu avatar Oct 30 '13 22:10 evgenyneu