I'm trying to configure vim to understand the jest output error format to be able to include it in the quickfix list. Although it does work partly (at least getting the file name and line/column number), I don't know why the quick fix list is displaying the other lines that are not matched
Here's my error format:
CompilerSet makeprg=node_modules/.bin/jest
CompilerSet errorformat=%.%#\ at\ %.%#(%f:%l:%c)
Here's a sample error output for jest
‚óè But parseInt accepts radix as second argument
expect(received).toBe(expected) // Object.is equality Expected: 4 Received: 3 16 | // parseInt uses the second argument to indicate radix 17 | expect(parseInt('3', 2)).toBe(NaN); // eslint-disable-line prefer-numeric-literals > 18 | expect(parseInt('11', 2)).toBe(4); // eslint-disable-line prefer-numeric-literals | ^ 19 | }); 20 | 21 | test('It could create problems when used as part of an higher-order function like map', () => { at Object.toBe (managing.functions.input.test.js:18:31)
I do this:
:compiler jest
:make
when I do :copen after this, it opens the quick fix list and jumps to the first error -- all good here.. but it also shows me all the lines above from the output. Ideally, I expect only one line per error in the quickfix list.
Admittedly, I haven't encoded the error message (%m) yet, but to start with I don't want all the output lines to be shown in the quick fix window. My understanding is that if a line doesn't match any format, it should be skipped ..isn't it?
Can somebody help me how to do this?
Also, if I type :clist, it does show me only the error line(s) - I expect similar output in quick fix list.
Thanks in advance