Open evgenyneu opened 11 years ago
What does the compiled coffee script look like? I would bet that the line mentioned in the error is of the transpiled coffeescript (i.e. the javascript), not the original coffeescript file.
@waynegerard, the JavaScript is
(function() {
describe('test', function() {
return it('fails', function() {
return expect(false).toBe(true);
});
});
}).call(this);
It is interesting, because error line numbers do not match JavaScript either. It is even more interesting because today there are no line numbers in the error report at all.
PhantomJS 1.9.2 (Mac OS X) test fails FAILED
Expected false to be true.
Hi! I have similar problem, in log window shown js number lines, not coffee how I could change this?
Same here. Can anyone clarify that it is a non-implemented feature (using pre-processors sourcemaps to show line numbers in origin file)? If it is supposed to be working, is any additional information needed regarding to configuration?
If you use default configuration, line numbers should be working - but not in PhantomJS
. Switching to Chrome
fixed the problem for me.
Same here. It seems to be a problem with PhantomJS. Running in Chrome fixes the issue. Too bad too, I much prefer error messages like TypeError: 'undefined' is not a function (evaluating 'calc.add()')
to TypeError: undefined is not a function
:( this should be supported by now.
edit: jk maybe it does. Setting sourceMap to true seems to do it: https://github.com/karma-runner/karma-coffee-preprocessor#configuration
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.Test output:
My config:
I am using: karma@0.10.4 karma-coffee-preprocessor@0.1.0 coffee-script@1.6.3
Thank you