parser.test.js 306 B

12345678910111213141516
  1. 'use strict'
  2. const { test } = require('tap')
  3. const { Parser } = require('../../lib')
  4. test('wrong protocol error', function (t) {
  5. const p = new Parser()
  6. p.once('error', function (err) {
  7. t.ok(err)
  8. t.end()
  9. })
  10. // Send some bogus data to incur an error
  11. p.write(Buffer.from([16, 1, 4]))
  12. })