1 | 'use strict';
|
2 |
|
3 |
|
4 | var test = require('tape').test
|
5 | var formatStream = require('../')
|
6 | var applyTransform = require('apply-transform');
|
7 | var json =
|
8 | '{ "name": "format-json-stream", '
|
9 | + '"version": "0.0.0", }'
|
10 | + '"main": "format-json-stream.js", "scripts": { "test": "tap test/*.js" } }'
|
11 |
|
12 | test('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 | })
|