Initial commit

This commit is contained in:
Spencer Pincott
2024-07-15 22:20:13 -04:00
commit 97737ca1ae
16618 changed files with 934131 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
const transform = require('..')
const assert = require('assert')
// Generate a dataset of 5 records
const records = 'record\n'.repeat(5).trim().split('\n')
let test_running = records.length
let test_started = records.length
let test_finished = 0
// Execute the transformation
transform(records, function(record, callback){
setTimeout( () => {
const {running, started, finished} = this
assert.equal(running, test_running--)
assert.equal(started, test_started)
assert.equal(finished, test_finished++)
callback(null, `${running}_${started}_${finished}\n`)
}, 100)
})
// Get notify on error
.on('end', function(){
process.stdout.write('-------\n')
const {running, started, finished} = this
process.stdout.write(`${running}_${started}_${finished}\n`)
})
// Print the transformed records to the standard output
.pipe(process.stdout)