| •1 |
const fs = require('fs'); |
| 2 |
const test = require('tape'); |
| 3 |
const getStream = require('get-stream'); |
| 4 |
const stripBomStream = require('.'); |
| 5 |
|
| 6 |
test('main', async t => { |
| 7 |
const result = await getStream(fs.createReadStream('fixture').pipe(stripBomStream())); |
| 8 |
t.is(result, 'Unicorn\n'); |
| •9 |
t.end(); |
| 10 |
}); |
| 11 |
|
| 12 |
test('low `highWaterMark`', async t => { |
| 13 |
const result = await getStream(fs.createReadStream('fixture', {highWaterMark: 1}).pipe(stripBomStream())); |
| 14 |
t.is(result, 'Unicorn\n'); |
| •15 |
t.end(); |
| 16 |
}); |