diff --git a/test/multicodec.spec.js b/test/multicodec.spec.js index 1878865..e966b20 100644 --- a/test/multicodec.spec.js +++ b/test/multicodec.spec.js @@ -89,7 +89,7 @@ describe('multicodec', () => { expect(multicodec.getNameFromCode(0x01a5)).to.eql('p2p') }) - it('throws error on unknown codec name when getting the code', () => { + it('throws error on unknown codec name when getting the varint from name', () => { expect(() => { // @ts-expect-error multicodec.getVarintFromName('this-codec-doesnt-exist') @@ -98,7 +98,16 @@ describe('multicodec', () => { ) }) - it('throws error on unknown codec name when getting the codec', () => { + it('throws error on unknown codec name when getting the code from name', () => { + expect(() => { + // @ts-expect-error + multicodec.getCodeFromName('this-codec-doesnt-exist') + }).to.throw( + 'Codec "this-codec-doesnt-exist" not found' + ) + }) + + it('throws error on unknown codec name when getting the name from the code', () => { const code = uint8ArrayFromString('ffee', 'base16') const buf = uint8ArrayFromString('hey')