Files
cannaiq/backend/node_modules/json-stream/test/throw-in-readable-test.js
2025-11-28 19:45:44 -07:00

13 lines
305 B
JavaScript

var assert = require('assert'),
JSONStream = require('../');
var stream = JSONStream();
stream.on('readable', function () {
throw new Error('This should crash and burn.');
});
assert.throws(function () {
stream.write('{"a":"b"}\n');
}, 'write with a throwing `readable` handler should throw');