/
eapostnova
/
2026-1--study--simulation-modeling
Обзор
Документация
Войти
/
eapostnova
/
2026-1--study--simulation-modeling
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
3
CI/CD
Аналитика
Безопасность
develop
node_modules/split/test/options.asynct.js
46 строк
851 B
Елизавета Постнова
chore(site): add changelog
06 мар 2026, 00:34
Верифицирован
06 мар 2026, 00:34
8cca814
Код
Авторство
О чём код?
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() } exports ['ignore trailing buffers'] = function (test) { var s = split(JSON.parse, null, { trailing: false }) , 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('{ "') s.end() it(caughtError).equal(false) it(rows).deepEqual([ { a: 1 } ]) test.done() }