Edge cases around non-fatal errors at EOF On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) threw exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid.. Should not throw or hang: new TextDecoder('utf-8').decode(new Uint8Array([0xff])) FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) should throw an exception. Was . Should not throw or hang: new TextDecoder('utf-16le').decode(new Uint8Array([0x00])) FAIL new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) should throw an exception. Was . Should not throw or hang: new TextDecoder('utf-16be').decode(new Uint8Array([0x00])); PASS successfullyParsed is true TEST COMPLETE