binary-parser
binary-parser copied to clipboard
Running "jest --coverage" throws an error when the Parser contains 'formatter'
Running "jest --coverage" throws an error when the Parser contains 'formatter'
I am seeing the same error without using formatter, but still using array. Perhaps the issue stems from the Parser contains 'array'
can use istanbul ignore, has to do with eval and such
parser: new Parser()
.uint8('compressionMethod', {
formatter: /* istanbul ignore next */ b => {
const method = [
'raw',
'gzip',
'bzip2',
'lzma',
'rans',
'rans4x16',
'arith',
'fqzcomp',
'tok3',
][b]
if (!method) {
throw new Error(`compression method number ${b} not implemented`)
}
return method
},
})