Commit project
This commit is contained in:
parent
28471965a0
commit
3ac017a5ad
1030 changed files with 94062 additions and 0 deletions
23
node_modules/split/test/options.asynct.js
generated
vendored
Normal file
23
node_modules/split/test/options.asynct.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
var it = require('it-is').style('colour')
|
||||
, split = require('..')
|
||||
|
||||
exports ['maximum buffer limit'] = function (test) {
|
||||
var s = split(JSON.parse, null, {
|
||||
maxLength: 2
|
||||
})
|
||||
, caughtError = false
|
||||
, rows = []
|
||||
|
||||
s.on('error', function (err) {
|
||||
caughtError = true
|
||||
})
|
||||
|
||||
s.on('data', function (row) { rows.push(row) })
|
||||
|
||||
s.write('{"a":1}\n{"')
|
||||
s.write('{ "')
|
||||
it(caughtError).equal(true)
|
||||
|
||||
s.end()
|
||||
test.done()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue