UNPKG

524 BJavaScriptView Raw
1'use strict';
2/*jshint asi: true */
3
4var test = require('tape').test
5var formatStream = require('../')
6var applyTransform = require('apply-transform');
7var json =
8 '{ "name": "format-json-stream", '
9 + '"version": "0.0.0", }'
10 + '"main": "format-json-stream.js", "scripts": { "test": "tap test/*.js" } }'
11
12test('errornous json', function (t) {
13 t.plan(1)
14 applyTransform(formatStream(), json, function (err, data) {
15 if (err) { t.fail(err); t.end(); }
16 t.ok(~data.indexOf('SyntaxError: '))
17 })
18})